Setup

1. Uva reef

Import Coral cover data

(Wide format)

# Read data 
  cover <- read.csv("Data/Uva_cover.csv", header=TRUE, sep = ",")
  #summary(cover)
  
# Convert variables and factors to right format
  # convert to numeric variables
  cover$Pocillopora <- as.numeric(cover$Pocillopora) 
  cover$Massive <- as.numeric(cover$Other_scleractinians)
  cover$Millepora <- as.numeric(cover$Millepora) 
  cover$Algae<- as.numeric(cover$Algae)
  cover$Substrate<- as.numeric(cover$Substrate)
  cover$YEAR <- as.numeric(cover$YEAR)
  # convert to nominal factors
  cover$Location <- as.factor(cover$Location) 

# Dates   
  # Note: all day from a month were converted to the 15th  
  cover$Date<-as.Date(cover$Date, format =  "%Y-%m-%d")

  #summary(cover)

Check transects/sample units

Explore data

Pocillopora

  • Pre-1982 Pocillopora cover in 4*5 = 77% manually added
  • Line = mean
  • Boxplots = median

Non-Pocillopora scleractinians (Uva)

  • Line = mean
  • Boxplots = median

Millepora (Uva)

  • Millepora sp. (individual transects)

Data analysis (Aggregated data)

Aggregate data (Pocillopora)

  • Hierarchically aggregate by date and location
# Aggregate by Dataset - Month -Year
  aggr.location <- aggregate(Pocillopora 
                             ~YEAR+Month+Location,
                             FUN=mean, data=cover)
  
  aggr.location$Year_F<-as.factor(aggr.location$YEAR)
  aggr.location$Date<-paste(aggr.location$YEAR, aggr.location$Month, "15", sep = "-")
  aggr.location$Date<-as.Date(aggr.location$Date, format = "%Y-%b-%d")
  str(aggr.location)
## 'data.frame':    89 obs. of  6 variables:
##  $ YEAR       : num  2016 2017 1984 1985 2014 ...
##  $ Month      : Factor w/ 12 levels "Apr","Aug","Dec",..: 1 1 2 2 2 2 2 3 3 3 ...
##  $ Location   : Factor w/ 3 levels "4x5","Uva_1m2",..: 1 1 1 1 1 1 1 1 1 1 ...
##  $ Pocillopora: num  57.28 71.659 0.242 0.62 73.07 ...
##  $ Year_F     : Factor w/ 29 levels "1980","1983",..: 27 28 3 4 25 26 29 1 3 9 ...
##  $ Date       : Date, format: "2016-04-15" "2017-04-15" ...
  #write.csv(aggr.location, 
   #       "Outputs/Pocillopora_mean_by_dataset.csv",
   #       row.names = F)

Stats Pocillopora for conceptual model (pooled datasets)

Pocillopora (model 1)

This model includes aggregated data from Chiriqui

  • Aggregated by location (Dataset)
  • YEAR is a continuous variable
  • Location (Dataset) as a random factor

  • Model is significant, but ignores high cover pre-1982

  • Data does not look normally distributed, which is ok, since the coral cover cannot be linear (Year as continuous), unless pre-1982 is removed?

** Do I need to change the intercept options?**

# # All years 1980_2018 
#   model1 <- lme(
#     Pocillopora ~ -1 + YEAR, random = ~1|Location, data=aggr.location)
#   summary(model1)
#   anova(model1)
#   
#   plot(ranef(model1))    # Symmetrical scatter effects around zero?
#   plot(model1)           # plot residuals vs fitted
#   resnorm1 <- resid(model1)
#   hist(resnorm1, xlab = "Residuals", main = "") # are residuals normally distributed?
#   coef.m1 <- as.data.frame(coef(summary(model1)))    # Coefficients of the model
#   
#   plot(model1, resid(., type = "p") ~ fitted(.) | Location, abline = 0)
#   plot(model1, Pocillopora ~ fitted(.), abline = c(0,1))

#-----
  model1 <- lme(
  Pocillopora ~ YEAR, random = ~1|Location, data=aggr.location)
  summary(model1)
## Linear mixed-effects model fit by REML
##   Data: aggr.location 
##        AIC      BIC    logLik
##   733.8074 743.6711 -362.9037
## 
## Random effects:
##  Formula: ~1 | Location
##         (Intercept) Residual
## StdDev:    9.141383 14.07197
## 
## Fixed effects:  Pocillopora ~ YEAR 
##                  Value Std.Error DF   t-value p-value
## (Intercept) -3022.5412 274.27885 85 -11.01996       0
## YEAR            1.5229   0.13718 85  11.10184       0
##  Correlation: 
##      (Intr)
## YEAR -1    
## 
## Standardized Within-Group Residuals:
##        Min         Q1        Med         Q3        Max 
## -1.4302381 -0.6011531 -0.2493395  0.4524815  5.3743803 
## 
## Number of Observations: 89
## Number of Groups: 3
  anova(model1)
  plot(ranef(model1))    # Symmetrical scatter effects around zero?
  plot(model1)           # plot residuals vs fitted
  resnorm1 <- resid(model1)
  hist(resnorm1, xlab = "Residuals", main = "") # are residuals normally distributed?
  coef.m1 <- as.data.frame(coef(summary(model1)))    # Coefficients of the model
  
  plot(model1, resid(., type = "p") ~ fitted(.) | Location, abline = 0)
  plot(model1, Pocillopora ~ fitted(.), abline = c(0,1))


#-----
  # library(lme4)
  # model1 <- lmer(Pocillopora ~ YEAR + (1|Location) -1, data=aggr.location)
  # summary(model1)
  # anova(model1)
  # 
  # plot(ranef(model1))    # Symmetrical scatter effects around zero?
  # plot(model1)           # plot residuals vs fitted
  # resnorm1 <- resid(model1)
  # hist(resnorm1, xlab = "Residuals", main = "") # are residuals normally distributed?
  # coef.m1 <- as.data.frame(coef(summary(model1)))    # Coefficients of the model
  # 
  # plot(model1, resid(., type = "p") ~ fitted(.) | Location, abline = 0)
  # plot(model1, Pocillopora ~ fitted(.), abline = c(0,1))

Model 1 (data) plot vs (predicted values)

Model_1 <- ggplot(aggr.location, aes(x=YEAR, y=Pocillopora)) +
  stat_boxplot(aes(group=YEAR), geom = 'errorbar')+
  geom_point(aes(colour=Location))+
  geom_smooth(method = lm, se=FALSE, linetype = "dashed", colour="red")+
  geom_smooth(span = 0.3, se=T, colour="darkgray")+ 

  scale_y_continuous("Pocillopora cover (%)",
                      breaks = seq(0, 80, by=10),
                     limits = c(-2, 80),
                     expand = c(0,0))+
  scale_x_continuous("", limits = c(1979, 2019),
                     breaks = seq(1980, 2018, by=2),
                     expand = c(0,0))+
  annotate("rect", xmin = 1982, xmax = 1983, 
           ymin = 0, ymax = 80,  alpha = .2, fill="gray")+
  annotate("rect", xmin = 1997, xmax = 1998, 
           ymin = 0, ymax = 80,  alpha = .2, fill="gray")+
  annotate("rect", xmin = 2015, xmax = 2016,
           ymin = 0, ymax = 80,  alpha = .2, fill="gray")+
  theme(legend.position = c(0.25, 0.8))+
  labs(title="Model 1 data")

Model 1

  • Extract model 1 predicted values
# Create a new data frame for independent variables  
NewData_1 <- expand.grid(Location=unique(aggr.location$Location),
                        YEAR=seq((min(aggr.location$YEAR)), (max(aggr.location$YEAR))))
pred_1 <- predict(model1 , newdata=NewData_1, level=0)
#summary(pred_1) 
#length(pred_1)
  • Plot model predictions
# Using model data 
  Model1_plot <- ggplot(aggr.location, 
                        aes(x=YEAR, y=Pocillopora, colour=Location)) +
      geom_point(aes(fill=factor(Location)),
                 shape = 21, colour = "black",
                 size = 2, stroke = 0.3, alpha=0.5) +
      
  scale_y_continuous("Pocillopora cover (%)", 
                     breaks = seq(0, 80, by=10), 
                     limits = c(-2, 80),
                     expand = c(0 ,0))+
  scale_x_continuous("", limits = c(1979, 2018),
                     breaks = seq(1980, 2018, by=2), 
                     expand = c(0.02,0.02))+
  
  geom_line(data=NewData_1, 
            aes(y=predict(model1, level=0, newdata=NewData_1)), size=2)+
  labs(title="Model 1 prediction")
  • Compare data and predictions
 Model1_All<-grid.arrange(Model_1, Model1_plot, ncol=2)

Pocillopora (model 1b: removing 1980 datapoints)

This model includes aggregated data from Chiriqui

  • Aggregated by location (Dataset)
  • YEAR is a continuous variable (1980 data removed)
  • Location (Dataset) as a random factor
aggr.locationb<-filter(aggr.location, YEAR>1983)
summary(aggr.locationb)
##       YEAR          Month           Location   Pocillopora          Year_F  
##  Min.   :1984   Mar    :22   4x5        :38   Min.   : 0.2145   1985   : 8  
##  1st Qu.:1989   Aug    :12   Uva_1m2    :18   1st Qu.: 1.5431   1984   : 7  
##  Median :1998   Jul    :10   UvRf-Chains:28   Median :13.6481   1997   : 5  
##  Mean   :1999   Apr    : 7                    Mean   :20.6337   2014   : 4  
##  3rd Qu.:2007   Feb    : 7                    3rd Qu.:33.1594   1989   : 3  
##  Max.   :2018   Jan    : 7                    Max.   :73.5546   1990   : 3  
##                 (Other):19                                      (Other):54  
##       Date           
##  Min.   :1984-06-15  
##  1st Qu.:1988-12-15  
##  Median :1997-12-29  
##  Mean   :1999-03-21  
##  3rd Qu.:2007-07-15  
##  Max.   :2018-08-15  
## 
  • Seems that removing the intercept is an issue…
# All years 1980_2018 

  model1b <- lme(
    Pocillopora ~ YEAR, random = ~1| Location, data=aggr.locationb)
  summary(model1b)
## Linear mixed-effects model fit by REML
##   Data: aggr.locationb 
##        AIC      BIC    logLik
##   640.7614 650.3883 -316.3807
## 
## Random effects:
##  Formula: ~1 | Location
##         (Intercept) Residual
## StdDev:     10.3104 10.13543
## 
## Fixed effects:  Pocillopora ~ YEAR 
##                 Value Std.Error DF   t-value p-value
## (Intercept) -3594.334 211.75305 80 -16.97418       0
## YEAR            1.808   0.10583 80  17.08316       0
##  Correlation: 
##      (Intr)
## YEAR -1    
## 
## Standardized Within-Group Residuals:
##        Min         Q1        Med         Q3        Max 
## -2.0731385 -0.6259668 -0.2151230  0.5055238  2.2714197 
## 
## Number of Observations: 84
## Number of Groups: 3
  anova(model1b)
  print(model1b)
## Linear mixed-effects model fit by REML
##   Data: aggr.locationb 
##   Log-restricted-likelihood: -316.3807
##   Fixed: Pocillopora ~ YEAR 
##  (Intercept)         YEAR 
## -3594.334410     1.807988 
## 
## Random effects:
##  Formula: ~1 | Location
##         (Intercept) Residual
## StdDev:     10.3104 10.13543
## 
## Number of Observations: 84
## Number of Groups: 3
  plot(ranef(model1b))    # Symmetrical scatter effects around zero?
  plot(model1b)           # plot residuals vs fitted
  resnorm1 <- resid(model1b)
  hist(resnorm1, xlab = "Residuals", main = "") # are residuals normally distributed?
  coef.m1 <- as.data.frame(coef(summary(model1b)))    # Coefficients of the model
  
  plot(model1b, resid(., type = "p") ~ fitted(.) | Location, abline = 0)
  plot(model1b, Pocillopora ~ fitted(.), abline = c(0,1))

Model 1b (data) plot

Model 1b

  • Extract model 1b predicted values
# Create a new data frame for independent variables  
NewData_1b <- expand.grid(Location=unique(aggr.locationb$Location),
                        YEAR=seq((min(aggr.locationb$YEAR)), (max(aggr.locationb$YEAR))))
pred_1b <- predict(model1b , newdata=NewData_1b, level=0)
#summary(pred_1) 
#length(pred_1)
  • Plot model predictions
# Using model data 
  Model1_plotb <- ggplot(aggr.locationb, 
                        aes(x=YEAR, y=Pocillopora, colour=Location)) +
      geom_point(aes(fill=factor(Location)),
                 shape = 21, colour = "black",
                 size = 2, stroke = 0.3, alpha=0.5) +
      
  scale_y_continuous("Pocillopora cover (%)", 
                     breaks = seq(0, 80, by=10), 
                     limits = c(-2, 80))+
  scale_x_continuous("", limits = c(1979, 2019),
                     breaks = seq(1980, 2018, by=2), 
                     expand = c(0.0,0.0))+

  geom_line(data=NewData_1b, 
            aes(y=predict(model1b, level=0, newdata=NewData_1b)), size=2)+
  labs(title="Model 1b prediction")

Model 1b (data) plot vs (predicted values)

 Model1b_All<-grid.arrange(Model_1b_data, Model1_plotb, ncol=2)

Pocillopora model 2 (+ multiple comparisons among years)

This model includes data from Chiriqui

  • Aggregated by location
  • Year is a factor
  • Location as a random factor

Results:

  • Model is significant
  • Better normality
# All years 1980_2018 
  model2 <- lme(
    Pocillopora ~ -1 + Year_F, random = ~1|Location, data=aggr.location)
    #summary(model2)
    anova(model2)
  plot(ranef(model2))    # Symmetrical scatter effects around zero?
  plot(model2)           # plot residuals vs fitted
  resnorm1 <- resid(model2)
  hist(resnorm1, xlab = "Residuals", main = "") # are residuals normally distributed?
  coef.m1 <- as.data.frame(coef(summary(model2)))    # Coefficients of the model
  
  plot(model2, resid(., type = "p") ~ fitted(.) | Location, abline = 0)
  plot(model2, Pocillopora ~ fitted(.), abline = c(0,1))

# Multicomp emmeans
    Year_F.emm<-emmeans(model2, ~Year_F)
    #contrast(Year_F.emm, "tukey")
    year_groups<-cld(Year_F.emm, by=NULL) # compact-letter display
    year_groups<-year_groups[order(year_groups$Year_F),] 
    year_groups

Multiple comparisons among years

  • Too many lines!

Summary:

  • 1980 is different from 1983-2001) -> Coral cover lose after 1981-82 ENSO
  • “Recovery” by ~2002 (no differences between 1980 and 2002) uninterrupted until 2018 -> no significant cover loss in 1997-98 nor 2015-16
# Multicomp emmeans glht
  m.comp_Pocillopora <- glht(model2, linfct = mcp(Year_F = "Tukey"))
  Model2_multipcomp<-summary(m.comp_Pocillopora, test = univariate())
  Model2_multipcomp
## 
##   Simultaneous Tests for General Linear Hypotheses
## 
## Multiple Comparisons of Means: Tukey Contrasts
## 
## 
## Fit: lme.formula(fixed = Pocillopora ~ -1 + Year_F, data = aggr.location, 
##     random = ~1 | Location)
## 
## Linear Hypotheses:
##                  Estimate Std. Error z value Pr(>|z|)    
## 1983 - 1980 == 0 -27.5268    10.6529  -2.584 0.009767 ** 
## 1984 - 1980 == 0 -51.2263     9.3265  -5.493 3.96e-08 ***
## 1985 - 1980 == 0 -48.7417     9.1672  -5.317 1.06e-07 ***
## 1986 - 1980 == 0 -43.2738    11.5586  -3.744 0.000181 ***
## 1987 - 1980 == 0 -43.0244    11.5586  -3.722 0.000197 ***
## 1988 - 1980 == 0 -42.0687    11.5586  -3.640 0.000273 ***
## 1989 - 1980 == 0 -46.4429    10.5628  -4.397 1.10e-05 ***
## 1990 - 1980 == 0 -45.3128    10.5628  -4.290 1.79e-05 ***
## 1992 - 1980 == 0 -40.1390    11.5586  -3.473 0.000515 ***
## 1993 - 1980 == 0 -39.4649    11.5586  -3.414 0.000639 ***
## 1994 - 1980 == 0 -40.4590    10.6089  -3.814 0.000137 ***
## 1995 - 1980 == 0 -34.2452    10.6089  -3.228 0.001247 ** 
## 1997 - 1980 == 0 -30.4038     9.7653  -3.113 0.001849 ** 
## 1998 - 1980 == 0 -28.9061    11.6998  -2.471 0.013487 *  
## 2000 - 1980 == 0 -24.7484    10.6089  -2.333 0.019659 *  
## 2001 - 1980 == 0 -23.8408    11.6987  -2.038 0.041559 *  
## 2002 - 1980 == 0 -15.3993    10.6089  -1.452 0.146628    
## 2003 - 1980 == 0 -13.0174    10.6089  -1.227 0.219814    
## 2004 - 1980 == 0  -7.9947    11.5586  -0.692 0.489148    
## 2005 - 1980 == 0  -9.4521    10.6089  -0.891 0.372954    
## 2006 - 1980 == 0  -0.9493    11.6987  -0.081 0.935326    
## 2007 - 1980 == 0  -6.0653    10.6089  -0.572 0.567514    
## 2010 - 1980 == 0  -1.0777    10.6089  -0.102 0.919089    
## 2014 - 1980 == 0  -1.8494    10.0510  -0.184 0.854010    
## 2015 - 1980 == 0   3.3501    10.6089   0.316 0.752171    
## 2016 - 1980 == 0  -4.3892    10.6089  -0.414 0.679075    
## 2017 - 1980 == 0  10.3873    10.6089   0.979 0.327526    
## 2018 - 1980 == 0  11.9443    10.6089   1.126 0.260219    
## 1984 - 1983 == 0 -23.6994     8.3630  -2.834 0.004599 ** 
## 1985 - 1983 == 0 -21.2149     8.1285  -2.610 0.009056 ** 
## 1986 - 1983 == 0 -15.7469    10.6529  -1.478 0.139361    
## 1987 - 1983 == 0 -15.4975    10.6529  -1.455 0.145734    
## 1988 - 1983 == 0 -14.5418    10.6529  -1.365 0.172237    
## 1989 - 1983 == 0 -18.9160     9.6380  -1.963 0.049686 *  
## 1990 - 1983 == 0 -17.7860     9.6380  -1.845 0.064979 .  
## 1992 - 1983 == 0 -12.6121    10.6529  -1.184 0.236449    
## 1993 - 1983 == 0 -11.9380    10.6529  -1.121 0.262443    
## 1994 - 1983 == 0 -12.9321     9.6133  -1.345 0.178549    
## 1995 - 1983 == 0  -6.7184     9.6133  -0.699 0.484636    
## 1997 - 1983 == 0  -2.8770     8.6234  -0.334 0.738662    
## 1998 - 1983 == 0  -1.3793    10.7048  -0.129 0.897478    
## 2000 - 1983 == 0   2.7785     9.6133   0.289 0.772561    
## 2001 - 1983 == 0   3.6861    10.9026   0.338 0.735296    
## 2002 - 1983 == 0  12.1275     9.6133   1.262 0.207116    
## 2003 - 1983 == 0  14.5095     9.6133   1.509 0.131219    
## 2004 - 1983 == 0  19.5322    10.6529   1.834 0.066728 .  
## 2005 - 1983 == 0  18.0748     9.6133   1.880 0.060083 .  
## 2006 - 1983 == 0  26.5775    10.9026   2.438 0.014780 *  
## 2007 - 1983 == 0  21.4616     9.6133   2.232 0.025583 *  
## 2010 - 1983 == 0  26.4492     9.6133   2.751 0.005936 ** 
## 2014 - 1983 == 0  25.6774     8.9340   2.874 0.004052 ** 
## 2015 - 1983 == 0  30.8769     9.6133   3.212 0.001319 ** 
## 2016 - 1983 == 0  23.1377     9.6133   2.407 0.016091 *  
## 2017 - 1983 == 0  37.9141     9.6133   3.944 8.02e-05 ***
## 2018 - 1983 == 0  39.4711     9.6133   4.106 4.03e-05 ***
## 1985 - 1984 == 0   2.4845     5.9904   0.415 0.678322    
## 1986 - 1984 == 0   7.9525     9.3265   0.853 0.393837    
## 1987 - 1984 == 0   8.2019     9.3265   0.879 0.379175    
## 1988 - 1984 == 0   9.1576     9.3265   0.982 0.326153    
## 1989 - 1984 == 0   4.7834     7.9957   0.598 0.549678    
## 1990 - 1984 == 0   5.9134     7.9957   0.740 0.459558    
## 1992 - 1984 == 0  11.0873     9.3265   1.189 0.234520    
## 1993 - 1984 == 0  11.7614     9.3265   1.261 0.207283    
## 1994 - 1984 == 0  10.7673     8.1206   1.326 0.184866    
## 1995 - 1984 == 0  16.9810     8.1206   2.091 0.036519 *  
## 1997 - 1984 == 0  20.8224     7.0266   2.963 0.003043 ** 
## 1998 - 1984 == 0  22.3201     9.5824   2.329 0.019844 *  
## 2000 - 1984 == 0  26.4779     8.1206   3.261 0.001112 ** 
## 2001 - 1984 == 0  27.3855     9.4194   2.907 0.003645 ** 
## 2002 - 1984 == 0  35.8269     8.1206   4.412 1.02e-05 ***
## 2003 - 1984 == 0  38.2089     8.1206   4.705 2.54e-06 ***
## 2004 - 1984 == 0  43.2316     9.3265   4.635 3.56e-06 ***
## 2005 - 1984 == 0  41.7742     8.1206   5.144 2.69e-07 ***
## 2006 - 1984 == 0  50.2770     9.4194   5.338 9.42e-08 ***
## 2007 - 1984 == 0  45.1610     8.1206   5.561 2.68e-08 ***
## 2010 - 1984 == 0  50.1486     8.1206   6.175 6.60e-10 ***
## 2014 - 1984 == 0  49.3769     7.4285   6.647 2.99e-11 ***
## 2015 - 1984 == 0  54.5763     8.1206   6.721 1.81e-11 ***
## 2016 - 1984 == 0  46.8371     8.1206   5.768 8.04e-09 ***
## 2017 - 1984 == 0  61.6136     8.1206   7.587 3.26e-14 ***
## 2018 - 1984 == 0  63.1706     8.1206   7.779 7.33e-15 ***
## 1986 - 1985 == 0   5.4680     9.1672   0.596 0.550862    
## 1987 - 1985 == 0   5.7173     9.1672   0.624 0.532843    
## 1988 - 1985 == 0   6.6731     9.1672   0.728 0.466658    
## 1989 - 1985 == 0   2.2988     7.8290   0.294 0.769040    
## 1990 - 1985 == 0   3.4289     7.8290   0.438 0.661406    
## 1992 - 1985 == 0   8.6028     9.1672   0.938 0.348025    
## 1993 - 1985 == 0   9.2768     9.1672   1.012 0.311559    
## 1994 - 1985 == 0   8.2828     7.9369   1.044 0.296685    
## 1995 - 1985 == 0  14.4965     7.9369   1.826 0.067782 .  
## 1997 - 1985 == 0  18.3379     6.7999   2.697 0.007001 ** 
## 1998 - 1985 == 0  19.8356     9.4027   2.110 0.034896 *  
## 2000 - 1985 == 0  23.9934     7.9369   3.023 0.002503 ** 
## 2001 - 1985 == 0  24.9010     9.2862   2.681 0.007329 ** 
## 2002 - 1985 == 0  33.3424     7.9369   4.201 2.66e-05 ***
## 2003 - 1985 == 0  35.7244     7.9369   4.501 6.76e-06 ***
## 2004 - 1985 == 0  40.7471     9.1672   4.445 8.80e-06 ***
## 2005 - 1985 == 0  39.2897     7.9369   4.950 7.41e-07 ***
## 2006 - 1985 == 0  47.7924     9.2862   5.147 2.65e-07 ***
## 2007 - 1985 == 0  42.6764     7.9369   5.377 7.58e-08 ***
## 2010 - 1985 == 0  47.6641     7.9369   6.005 1.91e-09 ***
## 2014 - 1985 == 0  46.8923     7.2113   6.503 7.90e-11 ***
## 2015 - 1985 == 0  52.0918     7.9369   6.563 5.27e-11 ***
## 2016 - 1985 == 0  44.3526     7.9369   5.588 2.30e-08 ***
## 2017 - 1985 == 0  59.1290     7.9369   7.450 9.35e-14 ***
## 2018 - 1985 == 0  60.6860     7.9369   7.646 2.07e-14 ***
## 1987 - 1986 == 0   0.2494    11.5586   0.022 0.982788    
## 1988 - 1986 == 0   1.2051    11.5586   0.104 0.916963    
## 1989 - 1986 == 0  -3.1691    10.5628  -0.300 0.764156    
## 1990 - 1986 == 0  -2.0391    10.5628  -0.193 0.846925    
## 1992 - 1986 == 0   3.1348    11.5586   0.271 0.786230    
## 1993 - 1986 == 0   3.8089    11.5586   0.330 0.741757    
## 1994 - 1986 == 0   2.8148    10.6089   0.265 0.790762    
## 1995 - 1986 == 0   9.0285    10.6089   0.851 0.394753    
## 1997 - 1986 == 0  12.8699     9.7653   1.318 0.187527    
## 1998 - 1986 == 0  14.3676    11.6998   1.228 0.219439    
## 2000 - 1986 == 0  18.5254    10.6089   1.746 0.080774 .  
## 2001 - 1986 == 0  19.4330    11.6987   1.661 0.096688 .  
## 2002 - 1986 == 0  27.8744    10.6089   2.627 0.008603 ** 
## 2003 - 1986 == 0  30.2564    10.6089   2.852 0.004345 ** 
## 2004 - 1986 == 0  35.2791    11.5586   3.052 0.002272 ** 
## 2005 - 1986 == 0  33.8217    10.6089   3.188 0.001432 ** 
## 2006 - 1986 == 0  42.3245    11.6987   3.618 0.000297 ***
## 2007 - 1986 == 0  37.2085    10.6089   3.507 0.000453 ***
## 2010 - 1986 == 0  42.1961    10.6089   3.977 6.97e-05 ***
## 2014 - 1986 == 0  41.4243    10.0510   4.121 3.77e-05 ***
## 2015 - 1986 == 0  46.6238    10.6089   4.395 1.11e-05 ***
## 2016 - 1986 == 0  38.8846    10.6089   3.665 0.000247 ***
## 2017 - 1986 == 0  53.6611    10.6089   5.058 4.23e-07 ***
## 2018 - 1986 == 0  55.2180    10.6089   5.205 1.94e-07 ***
## 1988 - 1987 == 0   0.9557    11.5586   0.083 0.934101    
## 1989 - 1987 == 0  -3.4185    10.5628  -0.324 0.746214    
## 1990 - 1987 == 0  -2.2885    10.5628  -0.217 0.828480    
## 1992 - 1987 == 0   2.8854    11.5586   0.250 0.802869    
## 1993 - 1987 == 0   3.5595    11.5586   0.308 0.758118    
## 1994 - 1987 == 0   2.5654    10.6089   0.242 0.808923    
## 1995 - 1987 == 0   8.7791    10.6089   0.828 0.407940    
## 1997 - 1987 == 0  12.6206     9.7653   1.292 0.196221    
## 1998 - 1987 == 0  14.1182    11.6998   1.207 0.227545    
## 2000 - 1987 == 0  18.2760    10.6089   1.723 0.084942 .  
## 2001 - 1987 == 0  19.1836    11.6987   1.640 0.101045    
## 2002 - 1987 == 0  27.6250    10.6089   2.604 0.009216 ** 
## 2003 - 1987 == 0  30.0070    10.6089   2.828 0.004677 ** 
## 2004 - 1987 == 0  35.0297    11.5586   3.031 0.002441 ** 
## 2005 - 1987 == 0  33.5723    10.6089   3.165 0.001553 ** 
## 2006 - 1987 == 0  42.0751    11.6987   3.597 0.000322 ***
## 2007 - 1987 == 0  36.9591    10.6089   3.484 0.000494 ***
## 2010 - 1987 == 0  41.9467    10.6089   3.954 7.69e-05 ***
## 2014 - 1987 == 0  41.1750    10.0510   4.097 4.19e-05 ***
## 2015 - 1987 == 0  46.3744    10.6089   4.371 1.24e-05 ***
## 2016 - 1987 == 0  38.6352    10.6089   3.642 0.000271 ***
## 2017 - 1987 == 0  53.4117    10.6089   5.035 4.79e-07 ***
## 2018 - 1987 == 0  54.9687    10.6089   5.181 2.20e-07 ***
## 1989 - 1988 == 0  -4.3742    10.5628  -0.414 0.678789    
## 1990 - 1988 == 0  -3.2442    10.5628  -0.307 0.758742    
## 1992 - 1988 == 0   1.9297    11.5586   0.167 0.867410    
## 1993 - 1988 == 0   2.6038    11.5586   0.225 0.821772    
## 1994 - 1988 == 0   1.6097    10.6089   0.152 0.879402    
## 1995 - 1988 == 0   7.8234    10.6089   0.737 0.460857    
## 1997 - 1988 == 0  11.6648     9.7653   1.195 0.232274    
## 1998 - 1988 == 0  13.1625    11.6998   1.125 0.260581    
## 2000 - 1988 == 0  17.3203    10.6089   1.633 0.102549    
## 2001 - 1988 == 0  18.2279    11.6987   1.558 0.119206    
## 2002 - 1988 == 0  26.6693    10.6089   2.514 0.011942 *  
## 2003 - 1988 == 0  29.0513    10.6089   2.738 0.006174 ** 
## 2004 - 1988 == 0  34.0740    11.5586   2.948 0.003199 ** 
## 2005 - 1988 == 0  32.6166    10.6089   3.074 0.002109 ** 
## 2006 - 1988 == 0  41.1194    11.6987   3.515 0.000440 ***
## 2007 - 1988 == 0  36.0034    10.6089   3.394 0.000690 ***
## 2010 - 1988 == 0  40.9910    10.6089   3.864 0.000112 ***
## 2014 - 1988 == 0  40.2192    10.0510   4.002 6.29e-05 ***
## 2015 - 1988 == 0  45.4187    10.6089   4.281 1.86e-05 ***
## 2016 - 1988 == 0  37.6795    10.6089   3.552 0.000383 ***
## 2017 - 1988 == 0  52.4559    10.6089   4.945 7.63e-07 ***
## 2018 - 1988 == 0  54.0129    10.6089   5.091 3.56e-07 ***
## 1990 - 1989 == 0   1.1301     9.4376   0.120 0.904689    
## 1992 - 1989 == 0   6.3039    10.5628   0.597 0.550638    
## 1993 - 1989 == 0   6.9780    10.5628   0.661 0.508856    
## 1994 - 1989 == 0   5.9839     9.5146   0.629 0.529401    
## 1995 - 1989 == 0  12.1976     9.5146   1.282 0.199844    
## 1997 - 1989 == 0  16.0391     8.5806   1.869 0.061591 .  
## 1998 - 1989 == 0  17.5368    10.7510   1.631 0.102852    
## 2000 - 1989 == 0  21.6945     9.5146   2.280 0.022599 *  
## 2001 - 1989 == 0  22.6021    10.6828   2.116 0.034367 *  
## 2002 - 1989 == 0  31.0436     9.5146   3.263 0.001103 ** 
## 2003 - 1989 == 0  33.4255     9.5146   3.513 0.000443 ***
## 2004 - 1989 == 0  38.4482    10.5628   3.640 0.000273 ***
## 2005 - 1989 == 0  36.9908     9.5146   3.888 0.000101 ***
## 2006 - 1989 == 0  45.4936    10.6828   4.259 2.06e-05 ***
## 2007 - 1989 == 0  40.3776     9.5146   4.244 2.20e-05 ***
## 2010 - 1989 == 0  45.3652     9.5146   4.768 1.86e-06 ***
## 2014 - 1989 == 0  44.5935     8.9082   5.006 5.56e-07 ***
## 2015 - 1989 == 0  49.7930     9.5146   5.233 1.66e-07 ***
## 2016 - 1989 == 0  42.0537     9.5146   4.420 9.87e-06 ***
## 2017 - 1989 == 0  56.8302     9.5146   5.973 2.33e-09 ***
## 2018 - 1989 == 0  58.3872     9.5146   6.137 8.43e-10 ***
## 1992 - 1990 == 0   5.1739    10.5628   0.490 0.624261    
## 1993 - 1990 == 0   5.8480    10.5628   0.554 0.579828    
## 1994 - 1990 == 0   4.8539     9.5146   0.510 0.609946    
## 1995 - 1990 == 0  11.0676     9.5146   1.163 0.244738    
## 1997 - 1990 == 0  14.9090     8.5806   1.738 0.082294 .  
## 1998 - 1990 == 0  16.4067    10.7510   1.526 0.126993    
## 2000 - 1990 == 0  20.5645     9.5146   2.161 0.030667 *  
## 2001 - 1990 == 0  21.4721    10.6828   2.010 0.044436 *  
## 2002 - 1990 == 0  29.9135     9.5146   3.144 0.001667 ** 
## 2003 - 1990 == 0  32.2955     9.5146   3.394 0.000688 ***
## 2004 - 1990 == 0  37.3182    10.5628   3.533 0.000411 ***
## 2005 - 1990 == 0  35.8608     9.5146   3.769 0.000164 ***
## 2006 - 1990 == 0  44.3635    10.6828   4.153 3.28e-05 ***
## 2007 - 1990 == 0  39.2475     9.5146   4.125 3.71e-05 ***
## 2010 - 1990 == 0  44.2352     9.5146   4.649 3.33e-06 ***
## 2014 - 1990 == 0  43.4634     8.9082   4.879 1.07e-06 ***
## 2015 - 1990 == 0  48.6629     9.5146   5.115 3.14e-07 ***
## 2016 - 1990 == 0  40.9237     9.5146   4.301 1.70e-05 ***
## 2017 - 1990 == 0  55.7001     9.5146   5.854 4.79e-09 ***
## 2018 - 1990 == 0  57.2571     9.5146   6.018 1.77e-09 ***
## 1993 - 1992 == 0   0.6741    11.5586   0.058 0.953496    
## 1994 - 1992 == 0  -0.3200    10.6089  -0.030 0.975935    
## 1995 - 1992 == 0   5.8937    10.6089   0.556 0.578523    
## 1997 - 1992 == 0   9.7351     9.7653   0.997 0.318806    
## 1998 - 1992 == 0  11.2328    11.6998   0.960 0.337012    
## 2000 - 1992 == 0  15.3906    10.6089   1.451 0.146857    
## 2001 - 1992 == 0  16.2982    11.6987   1.393 0.163570    
## 2002 - 1992 == 0  24.7396    10.6089   2.332 0.019703 *  
## 2003 - 1992 == 0  27.1216    10.6089   2.556 0.010573 *  
## 2004 - 1992 == 0  32.1443    11.5586   2.781 0.005419 ** 
## 2005 - 1992 == 0  30.6869    10.6089   2.893 0.003821 ** 
## 2006 - 1992 == 0  39.1897    11.6987   3.350 0.000808 ***
## 2007 - 1992 == 0  34.0737    10.6089   3.212 0.001319 ** 
## 2010 - 1992 == 0  39.0613    10.6089   3.682 0.000231 ***
## 2014 - 1992 == 0  38.2895    10.0510   3.810 0.000139 ***
## 2015 - 1992 == 0  43.4890    10.6089   4.099 4.14e-05 ***
## 2016 - 1992 == 0  35.7498    10.6089   3.370 0.000752 ***
## 2017 - 1992 == 0  50.5263    10.6089   4.763 1.91e-06 ***
## 2018 - 1992 == 0  52.0832    10.6089   4.909 9.14e-07 ***
## 1994 - 1993 == 0  -0.9941    10.6089  -0.094 0.925344    
## 1995 - 1993 == 0   5.2196    10.6089   0.492 0.622716    
## 1997 - 1993 == 0   9.0611     9.7653   0.928 0.353466    
## 1998 - 1993 == 0  10.5587    11.6998   0.902 0.366806    
## 2000 - 1993 == 0  14.7165    10.6089   1.387 0.165385    
## 2001 - 1993 == 0  15.6241    11.6987   1.336 0.181698    
## 2002 - 1993 == 0  24.0656    10.6089   2.268 0.023303 *  
## 2003 - 1993 == 0  26.4475    10.6089   2.493 0.012669 *  
## 2004 - 1993 == 0  31.4702    11.5586   2.723 0.006476 ** 
## 2005 - 1993 == 0  30.0128    10.6089   2.829 0.004669 ** 
## 2006 - 1993 == 0  38.5156    11.6987   3.292 0.000994 ***
## 2007 - 1993 == 0  33.3996    10.6089   3.148 0.001642 ** 
## 2010 - 1993 == 0  38.3872    10.6089   3.618 0.000296 ***
## 2014 - 1993 == 0  37.6155    10.0510   3.742 0.000182 ***
## 2015 - 1993 == 0  42.8149    10.6089   4.036 5.44e-05 ***
## 2016 - 1993 == 0  35.0757    10.6089   3.306 0.000946 ***
## 2017 - 1993 == 0  49.8522    10.6089   4.699 2.61e-06 ***
## 2018 - 1993 == 0  51.4092    10.6089   4.846 1.26e-06 ***
## 1995 - 1994 == 0   6.2137     9.4376   0.658 0.510278    
## 1997 - 1994 == 0  10.0552     8.4492   1.190 0.234019    
## 1998 - 1994 == 0  11.5528    10.5915   1.091 0.275376    
## 2000 - 1994 == 0  15.7106     9.4376   1.665 0.095974 .  
## 2001 - 1994 == 0  16.6182    10.5911   1.569 0.116631    
## 2002 - 1994 == 0  25.0596     9.4376   2.655 0.007924 ** 
## 2003 - 1994 == 0  27.4416     9.4376   2.908 0.003641 ** 
## 2004 - 1994 == 0  32.4643    10.6089   3.060 0.002213 ** 
## 2005 - 1994 == 0  31.0069     9.4376   3.285 0.001018 ** 
## 2006 - 1994 == 0  39.5097    10.5911   3.730 0.000191 ***
## 2007 - 1994 == 0  34.3937     9.4376   3.644 0.000268 ***
## 2010 - 1994 == 0  39.3813     9.4376   4.173 3.01e-05 ***
## 2014 - 1994 == 0  38.6096     8.8399   4.368 1.26e-05 ***
## 2015 - 1994 == 0  43.8090     9.4376   4.642 3.45e-06 ***
## 2016 - 1994 == 0  36.0698     9.4376   3.822 0.000132 ***
## 2017 - 1994 == 0  50.8463     9.4376   5.388 7.14e-08 ***
## 2018 - 1994 == 0  52.4033     9.4376   5.553 2.81e-08 ***
## 1997 - 1995 == 0   3.8414     8.4492   0.455 0.649362    
## 1998 - 1995 == 0   5.3391    10.5915   0.504 0.614196    
## 2000 - 1995 == 0   9.4969     9.4376   1.006 0.314277    
## 2001 - 1995 == 0  10.4045    10.5911   0.982 0.325913    
## 2002 - 1995 == 0  18.8459     9.4376   1.997 0.045835 *  
## 2003 - 1995 == 0  21.2279     9.4376   2.249 0.024493 *  
## 2004 - 1995 == 0  26.2506    10.6089   2.474 0.013346 *  
## 2005 - 1995 == 0  24.7932     9.4376   2.627 0.008612 ** 
## 2006 - 1995 == 0  33.2959    10.5911   3.144 0.001668 ** 
## 2007 - 1995 == 0  28.1800     9.4376   2.986 0.002827 ** 
## 2010 - 1995 == 0  33.1676     9.4376   3.514 0.000441 ***
## 2014 - 1995 == 0  32.3958     8.8399   3.665 0.000248 ***
## 2015 - 1995 == 0  37.5953     9.4376   3.984 6.79e-05 ***
## 2016 - 1995 == 0  29.8561     9.4376   3.164 0.001559 ** 
## 2017 - 1995 == 0  44.6325     9.4376   4.729 2.25e-06 ***
## 2018 - 1995 == 0  46.1895     9.4376   4.894 9.87e-07 ***
## 1998 - 1997 == 0   1.4977     9.6863   0.155 0.877122    
## 2000 - 1997 == 0   5.6555     8.4492   0.669 0.503273    
## 2001 - 1997 == 0   6.5630     9.7304   0.674 0.500000    
## 2002 - 1997 == 0  15.0045     8.4492   1.776 0.075759 .  
## 2003 - 1997 == 0  17.3865     8.4492   2.058 0.039613 *  
## 2004 - 1997 == 0  22.4092     9.7653   2.295 0.021746 *  
## 2005 - 1997 == 0  20.9518     8.4492   2.480 0.013148 *  
## 2006 - 1997 == 0  29.4545     9.7304   3.027 0.002469 ** 
## 2007 - 1997 == 0  24.3385     8.4492   2.881 0.003970 ** 
## 2010 - 1997 == 0  29.3262     8.4492   3.471 0.000519 ***
## 2014 - 1997 == 0  28.5544     7.7699   3.675 0.000238 ***
## 2015 - 1997 == 0  33.7539     8.4492   3.995 6.47e-05 ***
## 2016 - 1997 == 0  26.0146     8.4492   3.079 0.002077 ** 
## 2017 - 1997 == 0  40.7911     8.4492   4.828 1.38e-06 ***
## 2018 - 1997 == 0  42.3481     8.4492   5.012 5.38e-07 ***
## 2000 - 1998 == 0   4.1578    10.5915   0.393 0.694645    
## 2001 - 1998 == 0   5.0654    11.6513   0.435 0.663746    
## 2002 - 1998 == 0  13.5068    10.5915   1.275 0.202221    
## 2003 - 1998 == 0  15.8888    10.5915   1.500 0.133578    
## 2004 - 1998 == 0  20.9115    11.6998   1.787 0.073883 .  
## 2005 - 1998 == 0  19.4541    10.5915   1.837 0.066245 .  
## 2006 - 1998 == 0  27.9568    11.6513   2.399 0.016419 *  
## 2007 - 1998 == 0  22.8408    10.5915   2.157 0.031043 *  
## 2010 - 1998 == 0  27.8285    10.5915   2.627 0.008603 ** 
## 2014 - 1998 == 0  27.0567    10.0510   2.692 0.007104 ** 
## 2015 - 1998 == 0  32.2562    10.5915   3.045 0.002323 ** 
## 2016 - 1998 == 0  24.5170    10.5915   2.315 0.020625 *  
## 2017 - 1998 == 0  39.2934    10.5915   3.710 0.000207 ***
## 2018 - 1998 == 0  40.8504    10.5915   3.857 0.000115 ***
## 2001 - 2000 == 0   0.9076    10.5911   0.086 0.931712    
## 2002 - 2000 == 0   9.3490     9.4376   0.991 0.321872    
## 2003 - 2000 == 0  11.7310     9.4376   1.243 0.213864    
## 2004 - 2000 == 0  16.7537    10.6089   1.579 0.114288    
## 2005 - 2000 == 0  15.2963     9.4376   1.621 0.105063    
## 2006 - 2000 == 0  23.7991    10.5911   2.247 0.024635 *  
## 2007 - 2000 == 0  18.6831     9.4376   1.980 0.047743 *  
## 2010 - 2000 == 0  23.6707     9.4376   2.508 0.012137 *  
## 2014 - 2000 == 0  22.8989     8.8399   2.590 0.009586 ** 
## 2015 - 2000 == 0  28.0984     9.4376   2.977 0.002908 ** 
## 2016 - 2000 == 0  20.3592     9.4376   2.157 0.030986 *  
## 2017 - 2000 == 0  35.1356     9.4376   3.723 0.000197 ***
## 2018 - 2000 == 0  36.6926     9.4376   3.888 0.000101 ***
## 2002 - 2001 == 0   8.4414    10.5911   0.797 0.425432    
## 2003 - 2001 == 0  10.8234    10.5911   1.022 0.306812    
## 2004 - 2001 == 0  15.8461    11.6987   1.355 0.175570    
## 2005 - 2001 == 0  14.3887    10.5911   1.359 0.174283    
## 2006 - 2001 == 0  22.8915    11.5586   1.980 0.047650 *  
## 2007 - 2001 == 0  17.7755    10.5911   1.678 0.093280 .  
## 2010 - 2001 == 0  22.7631    10.5911   2.149 0.031613 *  
## 2014 - 2001 == 0  21.9914    10.1037   2.177 0.029512 *  
## 2015 - 2001 == 0  27.1908    10.5911   2.567 0.010248 *  
## 2016 - 2001 == 0  19.4516    10.5911   1.837 0.066269 .  
## 2017 - 2001 == 0  34.2281    10.5911   3.232 0.001230 ** 
## 2018 - 2001 == 0  35.7851    10.5911   3.379 0.000728 ***
## 2003 - 2002 == 0   2.3820     9.4376   0.252 0.800738    
## 2004 - 2002 == 0   7.4047    10.6089   0.698 0.485198    
## 2005 - 2002 == 0   5.9473     9.4376   0.630 0.528582    
## 2006 - 2002 == 0  14.4500    10.5911   1.364 0.172455    
## 2007 - 2002 == 0   9.3340     9.4376   0.989 0.322647    
## 2010 - 2002 == 0  14.3217     9.4376   1.518 0.129135    
## 2014 - 2002 == 0  13.5499     8.8399   1.533 0.125320    
## 2015 - 2002 == 0  18.7494     9.4376   1.987 0.046958 *  
## 2016 - 2002 == 0  11.0102     9.4376   1.167 0.243359    
## 2017 - 2002 == 0  25.7866     9.4376   2.732 0.006289 ** 
## 2018 - 2002 == 0  27.3436     9.4376   2.897 0.003764 ** 
## 2004 - 2003 == 0   5.0227    10.6089   0.473 0.635898    
## 2005 - 2003 == 0   3.5653     9.4376   0.378 0.705594    
## 2006 - 2003 == 0  12.0681    10.5911   1.139 0.254513    
## 2007 - 2003 == 0   6.9521     9.4376   0.737 0.461341    
## 2010 - 2003 == 0  11.9397     9.4376   1.265 0.205825    
## 2014 - 2003 == 0  11.1680     8.8399   1.263 0.206459    
## 2015 - 2003 == 0  16.3674     9.4376   1.734 0.082867 .  
## 2016 - 2003 == 0   8.6282     9.4376   0.914 0.360591    
## 2017 - 2003 == 0  23.4047     9.4376   2.480 0.013140 *  
## 2018 - 2003 == 0  24.9617     9.4376   2.645 0.008171 ** 
## 2005 - 2004 == 0  -1.4574    10.6089  -0.137 0.890736    
## 2006 - 2004 == 0   7.0454    11.6987   0.602 0.547016    
## 2007 - 2004 == 0   1.9294    10.6089   0.182 0.855690    
## 2010 - 2004 == 0   6.9170    10.6089   0.652 0.514401    
## 2014 - 2004 == 0   6.1453    10.0510   0.611 0.540929    
## 2015 - 2004 == 0  11.3447    10.6089   1.069 0.284908    
## 2016 - 2004 == 0   3.6055    10.6089   0.340 0.733966    
## 2017 - 2004 == 0  18.3820    10.6089   1.733 0.083151 .  
## 2018 - 2004 == 0  19.9390    10.6089   1.879 0.060183 .  
## 2006 - 2005 == 0   8.5028    10.5911   0.803 0.422078    
## 2007 - 2005 == 0   3.3868     9.4376   0.359 0.719700    
## 2010 - 2005 == 0   8.3744     9.4376   0.887 0.374892    
## 2014 - 2005 == 0   7.6026     8.8399   0.860 0.389767    
## 2015 - 2005 == 0  12.8021     9.4376   1.357 0.174938    
## 2016 - 2005 == 0   5.0629     9.4376   0.536 0.591641    
## 2017 - 2005 == 0  19.8394     9.4376   2.102 0.035538 *  
## 2018 - 2005 == 0  21.3963     9.4376   2.267 0.023381 *  
## 2007 - 2006 == 0  -5.1160    10.5911  -0.483 0.629062    
## 2010 - 2006 == 0  -0.1284    10.5911  -0.012 0.990330    
## 2014 - 2006 == 0  -0.9001    10.1037  -0.089 0.929011    
## 2015 - 2006 == 0   4.2994    10.5911   0.406 0.684786    
## 2016 - 2006 == 0  -3.4399    10.5911  -0.325 0.745339    
## 2017 - 2006 == 0  11.3366    10.5911   1.070 0.284444    
## 2018 - 2006 == 0  12.8936    10.5911   1.217 0.223452    
## 2010 - 2007 == 0   4.9876     9.4376   0.528 0.597161    
## 2014 - 2007 == 0   4.2159     8.8399   0.477 0.633422    
## 2015 - 2007 == 0   9.4154     9.4376   0.998 0.318450    
## 2016 - 2007 == 0   1.6761     9.4376   0.178 0.859037    
## 2017 - 2007 == 0  16.4526     9.4376   1.743 0.081279 .  
## 2018 - 2007 == 0  18.0096     9.4376   1.908 0.056354 .  
## 2014 - 2010 == 0  -0.7718     8.8399  -0.087 0.930429    
## 2015 - 2010 == 0   4.4277     9.4376   0.469 0.638955    
## 2016 - 2010 == 0  -3.3115     9.4376  -0.351 0.725672    
## 2017 - 2010 == 0  11.4650     9.4376   1.215 0.224433    
## 2018 - 2010 == 0  13.0220     9.4376   1.380 0.167648    
## 2015 - 2014 == 0   5.1995     8.8399   0.588 0.556408    
## 2016 - 2014 == 0  -2.5398     8.8399  -0.287 0.773876    
## 2017 - 2014 == 0  12.2367     8.8399   1.384 0.166277    
## 2018 - 2014 == 0  13.7937     8.8399   1.560 0.118666    
## 2016 - 2015 == 0  -7.7392     9.4376  -0.820 0.412189    
## 2017 - 2015 == 0   7.0372     9.4376   0.746 0.455871    
## 2018 - 2015 == 0   8.5942     9.4376   0.911 0.362484    
## 2017 - 2016 == 0  14.7765     9.4376   1.566 0.117416    
## 2018 - 2016 == 0  16.3335     9.4376   1.731 0.083507 .  
## 2018 - 2017 == 0   1.5570     9.4376   0.165 0.868961    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## (Univariate p values reported)

Model 2 plot (data)

Model2_data <- ggplot(aggr.location, aes(x=YEAR, y=Pocillopora)) +
  geom_boxplot(aes(group=YEAR), outlier.shape = NA) +
  stat_boxplot(aes(group=YEAR), geom = 'errorbar')+
 geom_point(aes(fill=factor(Location)),
                 shape = 21, colour = "black",
                 size = 2, stroke = 0.8, alpha=0.5) +
  stat_summary(fun.y=mean, geom="line", colour="gray")+

  scale_y_continuous("Pocillopora sp. cover (%)", limits = c(-2, 80),
                     breaks = seq(-0, 80, by=10),
                     expand = c(0,0))+
  scale_x_continuous("", limits = c(1979, 2019),
                     breaks = seq(1980, 2018, by=2), expand = c(0,0))+

  annotate("rect", xmin = 1983, xmax = 1984, 
           ymin = 0, ymax = 80,  alpha = .2, fill="gray")+
  annotate("rect", xmin = 1997.5, xmax = 1998.5, 
           ymin = 0, ymax = 80,  alpha = .2, fill="gray")+
  annotate("rect", xmin = 2015.5, xmax = 2016.5,
           ymin = 0, ymax = 80,  alpha = .2, fill="gray")+
  #ggtitle("Model 2 data")+
  theme(legend.position = c(0.25, 0.8))
#ggsave(file="Outputs/Fig_1.svg", plot=Model2_data, width=7, height=4.5)

Model 2 (predicted values)

  • Extract model 2 predicted values
# Option 1

  # Create a new data frame for independent variables  
  NewData_2 <- expand.grid(Location=unique(aggr.location$Location),
                          Year_F=unique(aggr.location$Year_F))
  pred_2 <- predict(model2 , newdata=NewData_2, re.form= ~(1|Location),
                    level=0)
  #summary(pred_2) 
  #length(pred_2)
  
  Predicted_Pocillopora<-cbind(NewData_2, pred_2)
  #write.csv(Predicted_Pocillopora, "Model2Predictions.c")

# Option 2
  # Effect plot
    Model2_plot<-plot(emmeans(model2, ~Year_F), comparisons = TRUE) +
        coord_flip(xlim = NULL, ylim = NULL, expand = TRUE) + theme_bw() +
        theme(axis.text.x = element_text(angle = 90)) + 
        ggtitle("Model 2 preditions")
 Model2_All<-grid.arrange(Model2_data, Model2_plot, ncol=2)

Aggregate data (Massives)

  • Hierarchically aggregate by location
# Aggregate by Location
  aggr.location.mas <- aggregate(Massive ~ YEAR+Month+Location, 
                        FUN=mean,data=cover)
  aggr.location.mas$Year_F<-as.factor(aggr.location.mas$YEAR)

Massives model (3)

This model includes aggregated data from Chiriqui

  • Aggregated by location
  • YEAR is a continuous variable
  • Location as a random factor

Model is NOT significant

# All years 1980_2018 
  Model3 <- lme(
    Massive ~ YEAR, random = ~1|Location, data=aggr.location.mas)
  summary(Model3)
## Linear mixed-effects model fit by REML
##   Data: aggr.location.mas 
##       AIC      BIC    logLik
##   126.818 136.6354 -59.40901
## 
## Random effects:
##  Formula: ~1 | Location
##         (Intercept)  Residual
## StdDev:   0.6923411 0.4240744
## 
## Fixed effects:  Massive ~ YEAR 
##                  Value Std.Error DF     t-value p-value
## (Intercept)  0.8176158  8.409001 84  0.09723103  0.9228
## YEAR        -0.0000784  0.004201 84 -0.01865474  0.9852
##  Correlation: 
##      (Intr)
## YEAR -0.999
## 
## Standardized Within-Group Residuals:
##        Min         Q1        Med         Q3        Max 
## -2.3873192 -0.5307017 -0.3106093  0.3116354  3.6839769 
## 
## Number of Observations: 88
## Number of Groups: 3
  anova(Model3)
  #plot(ranef(Model3))    # Symmetrical scatter effects around zero?
  #plot(Model3)           # plot residuals vs fitted
  #resnorm1 <- resid(Model3)
  #hist(resnorm1, xlab = "Residuals", main = "") # are residuals normally distributed?
  #coef.m1 <- as.data.frame(coef(summary(Model3)))    # Coefficients of the model
  
  #plot(Model3, resid(., type = "p") ~ fitted(.) | Location, abline = 0)
  #plot(Model3, Massive ~ fitted(.), abline = c(0,1))

Model 3 plot (Massives, non-significant)

Massives model 4 (+ multiple comparisons between years)

This model includes data from Chiriqui * aggregated by location * Year is a factor * location as a random factor

  • Model is significant*
# All years 1980_2018 
  Model4 <- lme(
    Massive ~ -1 + Year_F, random = ~1|Location, data=aggr.location.mas)
  #summary(Model4)
  anova(Model4)
  plot(ranef(Model4))    # Symmetrical scatter effects around zero?
  plot(Model4)           # plot residuals vs fitted
  resnorm1 <- resid(Model4)
  hist(resnorm1, xlab = "Residuals", main = "") # are residuals normally distributed?
  coef.m1 <- as.data.frame(coef(summary(Model4)))    # Coefficients of the model
  
  plot(Model4, resid(., type = "p") ~ fitted(.) | Location, abline = 0)
  plot(Model4, Massive ~ fitted(.), abline = c(0,1))

  # Multicomp
    Year_F.emm<-emmeans(Model4, ~Year_F)
    #contrast(Year_F.emm, "tukey")
    year_groups<-cld(Year_F.emm, by=NULL) # compact-letter display
    year_groups<-year_groups[order(year_groups$Year_F),] 
    year_groups

Multiple comparisons among years

Summary:

  • 1980 is different from every year (1983-2018) -> Non-Pocillopora coral cover loss after 1981-82 ENSO has not recovered to pre-1982 values
  • 1994-1997 artifact differences by incorporating Uva1m2?
  • 1997 marginally different from 1998 (p=0.06)
  • 1997 different from 1999-2018 (p<0.05), except 2004-2006 -> Massive coral cover lose after 1997-98 ENSO has not recovered to pre-1997 values
m.comp_Massive <- glht(Model4, linfct = mcp(Year_F = "Tukey"))
summary(m.comp_Massive, test = univariate())
## 
##   Simultaneous Tests for General Linear Hypotheses
## 
## Multiple Comparisons of Means: Tukey Contrasts
## 
## 
## Fit: lme.formula(fixed = Massive ~ -1 + Year_F, data = aggr.location.mas, 
##     random = ~1 | Location)
## 
## Linear Hypotheses:
##                    Estimate Std. Error z value Pr(>|z|)    
## 1983 - 1980 == 0 -1.5981735  0.4161884  -3.840 0.000123 ***
## 1984 - 1980 == 0 -1.7098030  0.3936957  -4.343 1.41e-05 ***
## 1985 - 1980 == 0 -1.7104907  0.3887756  -4.400 1.08e-05 ***
## 1986 - 1980 == 0 -1.6840729  0.4439435  -3.793 0.000149 ***
## 1987 - 1980 == 0 -1.6134226  0.4439435  -3.634 0.000279 ***
## 1988 - 1980 == 0 -1.6506134  0.4439435  -3.718 0.000201 ***
## 1989 - 1980 == 0 -1.6880286  0.4209061  -4.010 6.06e-05 ***
## 1990 - 1980 == 0 -1.6863556  0.4209061  -4.006 6.16e-05 ***
## 1992 - 1980 == 0 -1.5621779  0.4439435  -3.519 0.000433 ***
## 1993 - 1980 == 0 -1.3730574  0.4439435  -3.093 0.001982 ** 
## 1994 - 1980 == 0 -1.0207870  0.4202995  -2.429 0.015153 *  
## 1995 - 1980 == 0 -0.7406507  0.4202995  -1.762 0.078036 .  
## 1997 - 1980 == 0 -0.8868720  0.3988428  -2.224 0.026174 *  
## 1998 - 1980 == 0 -1.4535131  0.4451828  -3.265 0.001095 ** 
## 2000 - 1980 == 0 -1.4398855  0.4202995  -3.426 0.000613 ***
## 2001 - 1980 == 0 -1.4992969  0.4501133  -3.331 0.000866 ***
## 2002 - 1980 == 0 -1.4004362  0.4202995  -3.332 0.000862 ***
## 2003 - 1980 == 0 -1.4144354  0.4202995  -3.365 0.000765 ***
## 2004 - 1980 == 0 -1.1035111  0.4439435  -2.486 0.012930 *  
## 2005 - 1980 == 0 -1.3927795  0.4202995  -3.314 0.000920 ***
## 2006 - 1980 == 0 -1.2553504  0.4501133  -2.789 0.005288 ** 
## 2007 - 1980 == 0 -1.4130870  0.4202995  -3.362 0.000774 ***
## 2010 - 1980 == 0 -1.4128769  0.4202995  -3.362 0.000775 ***
## 2014 - 1980 == 0 -1.4734259  0.4053657  -3.635 0.000278 ***
## 2015 - 1980 == 0 -1.4309372  0.4202995  -3.405 0.000663 ***
## 2016 - 1980 == 0 -1.7594832  0.4202995  -4.186 2.84e-05 ***
## 2017 - 1980 == 0 -1.5731163  0.4202995  -3.743 0.000182 ***
## 2018 - 1980 == 0 -1.6500693  0.4202995  -3.926 8.64e-05 ***
## 1984 - 1983 == 0 -0.1116295  0.2615147  -0.427 0.669483    
## 1985 - 1983 == 0 -0.1123172  0.2540474  -0.442 0.658409    
## 1986 - 1983 == 0 -0.0858994  0.3323844  -0.258 0.796072    
## 1987 - 1983 == 0 -0.0152491  0.3323844  -0.046 0.963408    
## 1988 - 1983 == 0 -0.0524399  0.3323844  -0.158 0.874639    
## 1989 - 1983 == 0 -0.0898550  0.3009245  -0.299 0.765248    
## 1990 - 1983 == 0 -0.0881820  0.3009245  -0.293 0.769494    
## 1992 - 1983 == 0  0.0359956  0.3323844   0.108 0.913762    
## 1993 - 1983 == 0  0.2251161  0.3323844   0.677 0.498231    
## 1994 - 1983 == 0  0.5773865  0.3000755   1.924 0.054337 .  
## 1995 - 1983 == 0  0.8575228  0.3000755   2.858 0.004267 ** 
## 1997 - 1983 == 0  0.7113015  0.2692010   2.642 0.008235 ** 
## 1998 - 1983 == 0  0.1446604  0.3340379   0.433 0.664967    
## 2000 - 1983 == 0  0.1582881  0.3000755   0.527 0.597851    
## 2001 - 1983 == 0  0.0988766  0.3405812   0.290 0.771574    
## 2002 - 1983 == 0  0.1977373  0.3000755   0.659 0.509922    
## 2003 - 1983 == 0  0.1837381  0.3000755   0.612 0.540335    
## 2004 - 1983 == 0  0.4946625  0.3323844   1.488 0.136692    
## 2005 - 1983 == 0  0.2053940  0.3000755   0.684 0.493676    
## 2006 - 1983 == 0  0.3428231  0.3405812   1.007 0.314135    
## 2007 - 1983 == 0  0.1850866  0.3000755   0.617 0.537367    
## 2010 - 1983 == 0  0.1852966  0.3000755   0.617 0.536905    
## 2014 - 1983 == 0  0.1247477  0.2787741   0.447 0.654524    
## 2015 - 1983 == 0  0.1672363  0.3000755   0.557 0.577313    
## 2016 - 1983 == 0 -0.1613096  0.3000755  -0.538 0.590878    
## 2017 - 1983 == 0  0.0250572  0.3000755   0.084 0.933452    
## 2018 - 1983 == 0 -0.0518958  0.3000755  -0.173 0.862697    
## 1985 - 1984 == 0 -0.0006877  0.1868133  -0.004 0.997063    
## 1986 - 1984 == 0  0.0257301  0.2909410   0.088 0.929529    
## 1987 - 1984 == 0  0.0963804  0.2909410   0.331 0.740440    
## 1988 - 1984 == 0  0.0591896  0.2909410   0.203 0.838790    
## 1989 - 1984 == 0  0.0217744  0.2493674   0.087 0.930418    
## 1990 - 1984 == 0  0.0234474  0.2493674   0.094 0.925087    
## 1992 - 1984 == 0  0.1476250  0.2909410   0.507 0.611870    
## 1993 - 1984 == 0  0.3367455  0.2909410   1.157 0.247094    
## 1994 - 1984 == 0  0.6890160  0.2534664   2.718 0.006560 ** 
## 1995 - 1984 == 0  0.9691523  0.2534664   3.824 0.000132 ***
## 1997 - 1984 == 0  0.8229309  0.2195423   3.748 0.000178 ***
## 1998 - 1984 == 0  0.2562899  0.2993420   0.856 0.391900    
## 2000 - 1984 == 0  0.2699175  0.2534664   1.065 0.286919    
## 2001 - 1984 == 0  0.2105060  0.2939450   0.716 0.473904    
## 2002 - 1984 == 0  0.3093667  0.2534664   1.221 0.222259    
## 2003 - 1984 == 0  0.2953676  0.2534664   1.165 0.243892    
## 2004 - 1984 == 0  0.6062919  0.2909410   2.084 0.037169 *  
## 2005 - 1984 == 0  0.3170234  0.2534664   1.251 0.211025    
## 2006 - 1984 == 0  0.4544526  0.2939450   1.546 0.122093    
## 2007 - 1984 == 0  0.2967160  0.2534664   1.171 0.241747    
## 2010 - 1984 == 0  0.2969261  0.2534664   1.171 0.241413    
## 2014 - 1984 == 0  0.2363771  0.2319715   1.019 0.308207    
## 2015 - 1984 == 0  0.2788657  0.2534664   1.100 0.271242    
## 2016 - 1984 == 0 -0.0496802  0.2534664  -0.196 0.844608    
## 2017 - 1984 == 0  0.1366867  0.2534664   0.539 0.589701    
## 2018 - 1984 == 0  0.0597337  0.2534664   0.236 0.813691    
## 1986 - 1985 == 0  0.0264178  0.2859176   0.092 0.926383    
## 1987 - 1985 == 0  0.0970681  0.2859176   0.339 0.734235    
## 1988 - 1985 == 0  0.0598773  0.2859176   0.209 0.834119    
## 1989 - 1985 == 0  0.0224621  0.2441385   0.092 0.926693    
## 1990 - 1985 == 0  0.0241351  0.2441385   0.099 0.921251    
## 1992 - 1985 == 0  0.1483128  0.2859176   0.519 0.603952    
## 1993 - 1985 == 0  0.3374333  0.2859176   1.180 0.237930    
## 1994 - 1985 == 0  0.6897037  0.2476758   2.785 0.005358 ** 
## 1995 - 1985 == 0  0.9698400  0.2476758   3.916 9.01e-05 ***
## 1997 - 1985 == 0  0.8236187  0.2123810   3.878 0.000105 ***
## 1998 - 1985 == 0  0.2569776  0.2936421   0.875 0.381498    
## 2000 - 1985 == 0  0.2706052  0.2476758   1.093 0.274579    
## 2001 - 1985 == 0  0.2111938  0.2897856   0.729 0.466128    
## 2002 - 1985 == 0  0.3100545  0.2476758   1.252 0.210622    
## 2003 - 1985 == 0  0.2960553  0.2476758   1.195 0.231957    
## 2004 - 1985 == 0  0.6069796  0.2859176   2.123 0.033761 *  
## 2005 - 1985 == 0  0.3177112  0.2476758   1.283 0.199573    
## 2006 - 1985 == 0  0.4551403  0.2897856   1.571 0.116273    
## 2007 - 1985 == 0  0.2974037  0.2476758   1.201 0.229837    
## 2010 - 1985 == 0  0.2976138  0.2476758   1.202 0.229508    
## 2014 - 1985 == 0  0.2370648  0.2251042   1.053 0.292280    
## 2015 - 1985 == 0  0.2795535  0.2476758   1.129 0.259021    
## 2016 - 1985 == 0 -0.0489924  0.2476758  -0.198 0.843195    
## 2017 - 1985 == 0  0.1373744  0.2476758   0.555 0.579131    
## 2018 - 1985 == 0  0.0604214  0.2476758   0.244 0.807267    
## 1987 - 1986 == 0  0.0706503  0.3604297   0.196 0.844597    
## 1988 - 1986 == 0  0.0334595  0.3604297   0.093 0.926037    
## 1989 - 1986 == 0 -0.0039557  0.3294007  -0.012 0.990419    
## 1990 - 1986 == 0 -0.0022827  0.3294007  -0.007 0.994471    
## 1992 - 1986 == 0  0.1218949  0.3604297   0.338 0.735217    
## 1993 - 1986 == 0  0.3110154  0.3604297   0.863 0.388191    
## 1994 - 1986 == 0  0.6632859  0.3308996   2.004 0.045017 *  
## 1995 - 1986 == 0  0.9434222  0.3308996   2.851 0.004357 ** 
## 1997 - 1986 == 0  0.7972008  0.3046486   2.617 0.008876 ** 
## 1998 - 1986 == 0  0.2305598  0.3650499   0.632 0.527659    
## 2000 - 1986 == 0  0.2441874  0.3308996   0.738 0.460545    
## 2001 - 1986 == 0  0.1847759  0.3650108   0.506 0.612702    
## 2002 - 1986 == 0  0.2836366  0.3308996   0.857 0.391352    
## 2003 - 1986 == 0  0.2696375  0.3308996   0.815 0.415151    
## 2004 - 1986 == 0  0.5805618  0.3604297   1.611 0.107234    
## 2005 - 1986 == 0  0.2912933  0.3308996   0.880 0.378693    
## 2006 - 1986 == 0  0.4287225  0.3650108   1.175 0.240176    
## 2007 - 1986 == 0  0.2709859  0.3308996   0.819 0.412822    
## 2010 - 1986 == 0  0.2711960  0.3308996   0.820 0.412460    
## 2014 - 1986 == 0  0.2106470  0.3134807   0.672 0.501608    
## 2015 - 1986 == 0  0.2531356  0.3308996   0.765 0.444276    
## 2016 - 1986 == 0 -0.0754103  0.3308996  -0.228 0.819728    
## 2017 - 1986 == 0  0.1109566  0.3308996   0.335 0.737385    
## 2018 - 1986 == 0  0.0340036  0.3308996   0.103 0.918153    
## 1988 - 1987 == 0 -0.0371908  0.3604297  -0.103 0.917816    
## 1989 - 1987 == 0 -0.0746060  0.3294007  -0.226 0.820820    
## 1990 - 1987 == 0 -0.0729330  0.3294007  -0.221 0.824772    
## 1992 - 1987 == 0  0.0512447  0.3604297   0.142 0.886941    
## 1993 - 1987 == 0  0.2403652  0.3604297   0.667 0.504846    
## 1994 - 1987 == 0  0.5926356  0.3308996   1.791 0.073296 .  
## 1995 - 1987 == 0  0.8727719  0.3308996   2.638 0.008350 ** 
## 1997 - 1987 == 0  0.7265506  0.3046486   2.385 0.017085 *  
## 1998 - 1987 == 0  0.1599095  0.3650499   0.438 0.661351    
## 2000 - 1987 == 0  0.1735371  0.3308996   0.524 0.599972    
## 2001 - 1987 == 0  0.1141257  0.3650108   0.313 0.754536    
## 2002 - 1987 == 0  0.2129864  0.3308996   0.644 0.519797    
## 2003 - 1987 == 0  0.1989872  0.3308996   0.601 0.547605    
## 2004 - 1987 == 0  0.5099115  0.3604297   1.415 0.157147    
## 2005 - 1987 == 0  0.2206431  0.3308996   0.667 0.504901    
## 2006 - 1987 == 0  0.3580722  0.3650108   0.981 0.326597    
## 2007 - 1987 == 0  0.2003356  0.3308996   0.605 0.544895    
## 2010 - 1987 == 0  0.2005457  0.3308996   0.606 0.544474    
## 2014 - 1987 == 0  0.1399967  0.3134807   0.447 0.655173    
## 2015 - 1987 == 0  0.1824853  0.3308996   0.551 0.581303    
## 2016 - 1987 == 0 -0.1460606  0.3308996  -0.441 0.658920    
## 2017 - 1987 == 0  0.0403063  0.3308996   0.122 0.903051    
## 2018 - 1987 == 0 -0.0366467  0.3308996  -0.111 0.911816    
## 1989 - 1988 == 0 -0.0374152  0.3294007  -0.114 0.909566    
## 1990 - 1988 == 0 -0.0357422  0.3294007  -0.109 0.913594    
## 1992 - 1988 == 0  0.0884355  0.3604297   0.245 0.806177    
## 1993 - 1988 == 0  0.2775560  0.3604297   0.770 0.441259    
## 1994 - 1988 == 0  0.6298264  0.3308996   1.903 0.056991 .  
## 1995 - 1988 == 0  0.9099627  0.3308996   2.750 0.005960 ** 
## 1997 - 1988 == 0  0.7637414  0.3046486   2.507 0.012177 *  
## 1998 - 1988 == 0  0.1971003  0.3650499   0.540 0.589247    
## 2000 - 1988 == 0  0.2107279  0.3308996   0.637 0.524233    
## 2001 - 1988 == 0  0.1513165  0.3650108   0.415 0.678469    
## 2002 - 1988 == 0  0.2501772  0.3308996   0.756 0.449618    
## 2003 - 1988 == 0  0.2361780  0.3308996   0.714 0.475385    
## 2004 - 1988 == 0  0.5471023  0.3604297   1.518 0.129035    
## 2005 - 1988 == 0  0.2578339  0.3308996   0.779 0.435867    
## 2006 - 1988 == 0  0.3952630  0.3650108   1.083 0.278862    
## 2007 - 1988 == 0  0.2375264  0.3308996   0.718 0.472868    
## 2010 - 1988 == 0  0.2377365  0.3308996   0.718 0.472477    
## 2014 - 1988 == 0  0.1771875  0.3134807   0.565 0.571920    
## 2015 - 1988 == 0  0.2196762  0.3308996   0.664 0.506770    
## 2016 - 1988 == 0 -0.1088697  0.3308996  -0.329 0.742147    
## 2017 - 1988 == 0  0.0774971  0.3308996   0.234 0.814829    
## 2018 - 1988 == 0  0.0005441  0.3308996   0.002 0.998688    
## 1990 - 1989 == 0  0.0016730  0.2942896   0.006 0.995464    
## 1992 - 1989 == 0  0.1258506  0.3294007   0.382 0.702417    
## 1993 - 1989 == 0  0.3149711  0.3294007   0.956 0.338974    
## 1994 - 1989 == 0  0.6672415  0.2968099   2.248 0.024573 *  
## 1995 - 1989 == 0  0.9473779  0.2968099   3.192 0.001414 ** 
## 1997 - 1989 == 0  0.8011565  0.2677868   2.992 0.002774 ** 
## 1998 - 1989 == 0  0.2345155  0.3355691   0.699 0.484640    
## 2000 - 1989 == 0  0.2481431  0.2968099   0.836 0.403136    
## 2001 - 1989 == 0  0.1887316  0.3333124   0.566 0.571237    
## 2002 - 1989 == 0  0.2875923  0.2968099   0.969 0.332573    
## 2003 - 1989 == 0  0.2735932  0.2968099   0.922 0.356644    
## 2004 - 1989 == 0  0.5845175  0.3294007   1.774 0.075983 .  
## 2005 - 1989 == 0  0.2952490  0.2968099   0.995 0.319862    
## 2006 - 1989 == 0  0.4326781  0.3333124   1.298 0.194247    
## 2007 - 1989 == 0  0.2749416  0.2968099   0.926 0.354279    
## 2010 - 1989 == 0  0.2751516  0.2968099   0.927 0.353911    
## 2014 - 1989 == 0  0.2146027  0.2779215   0.772 0.440014    
## 2015 - 1989 == 0  0.2570913  0.2968099   0.866 0.386390    
## 2016 - 1989 == 0 -0.0714546  0.2968099  -0.241 0.809755    
## 2017 - 1989 == 0  0.1149123  0.2968099   0.387 0.698639    
## 2018 - 1989 == 0  0.0379593  0.2968099   0.128 0.898235    
## 1992 - 1990 == 0  0.1241776  0.3294007   0.377 0.706188    
## 1993 - 1990 == 0  0.3132981  0.3294007   0.951 0.341546    
## 1994 - 1990 == 0  0.6655686  0.2968099   2.242 0.024935 *  
## 1995 - 1990 == 0  0.9457049  0.2968099   3.186 0.001441 ** 
## 1997 - 1990 == 0  0.7994835  0.2677868   2.986 0.002831 ** 
## 1998 - 1990 == 0  0.2328425  0.3355691   0.694 0.487762    
## 2000 - 1990 == 0  0.2464701  0.2968099   0.830 0.406314    
## 2001 - 1990 == 0  0.1870586  0.3333124   0.561 0.574654    
## 2002 - 1990 == 0  0.2859193  0.2968099   0.963 0.335393    
## 2003 - 1990 == 0  0.2719202  0.2968099   0.916 0.359592    
## 2004 - 1990 == 0  0.5828445  0.3294007   1.769 0.076826 .  
## 2005 - 1990 == 0  0.2935760  0.2968099   0.989 0.322612    
## 2006 - 1990 == 0  0.4310052  0.3333124   1.293 0.195978    
## 2007 - 1990 == 0  0.2732686  0.2968099   0.921 0.357215    
## 2010 - 1990 == 0  0.2734787  0.2968099   0.921 0.356845    
## 2014 - 1990 == 0  0.2129297  0.2779215   0.766 0.443587    
## 2015 - 1990 == 0  0.2554183  0.2968099   0.861 0.389489    
## 2016 - 1990 == 0 -0.0731276  0.2968099  -0.246 0.805389    
## 2017 - 1990 == 0  0.1132393  0.2968099   0.382 0.702816    
## 2018 - 1990 == 0  0.0362863  0.2968099   0.122 0.902698    
## 1993 - 1992 == 0  0.1891205  0.3604297   0.525 0.599786    
## 1994 - 1992 == 0  0.5413909  0.3308996   1.636 0.101815    
## 1995 - 1992 == 0  0.8215272  0.3308996   2.483 0.013039 *  
## 1997 - 1992 == 0  0.6753059  0.3046486   2.217 0.026646 *  
## 1998 - 1992 == 0  0.1086648  0.3650499   0.298 0.765954    
## 2000 - 1992 == 0  0.1222925  0.3308996   0.370 0.711699    
## 2001 - 1992 == 0  0.0628810  0.3650108   0.172 0.863224    
## 2002 - 1992 == 0  0.1617417  0.3308996   0.489 0.624988    
## 2003 - 1992 == 0  0.1477425  0.3308996   0.446 0.655245    
## 2004 - 1992 == 0  0.4586669  0.3604297   1.273 0.203176    
## 2005 - 1992 == 0  0.1693984  0.3308996   0.512 0.608698    
## 2006 - 1992 == 0  0.3068275  0.3650108   0.841 0.400573    
## 2007 - 1992 == 0  0.1490910  0.3308996   0.451 0.652305    
## 2010 - 1992 == 0  0.1493010  0.3308996   0.451 0.651847    
## 2014 - 1992 == 0  0.0887521  0.3134807   0.283 0.777086    
## 2015 - 1992 == 0  0.1312407  0.3308996   0.397 0.691649    
## 2016 - 1992 == 0 -0.1973052  0.3308996  -0.596 0.550995    
## 2017 - 1992 == 0 -0.0109383  0.3308996  -0.033 0.973630    
## 2018 - 1992 == 0 -0.0878914  0.3308996  -0.266 0.790537    
## 1994 - 1993 == 0  0.3522704  0.3308996   1.065 0.287064    
## 1995 - 1993 == 0  0.6324067  0.3308996   1.911 0.055982 .  
## 1997 - 1993 == 0  0.4861854  0.3046486   1.596 0.110514    
## 1998 - 1993 == 0 -0.0804557  0.3650499  -0.220 0.825563    
## 2000 - 1993 == 0 -0.0668280  0.3308996  -0.202 0.839949    
## 2001 - 1993 == 0 -0.1262395  0.3650108  -0.346 0.729454    
## 2002 - 1993 == 0 -0.0273788  0.3308996  -0.083 0.934058    
## 2003 - 1993 == 0 -0.0413780  0.3308996  -0.125 0.900486    
## 2004 - 1993 == 0  0.2695464  0.3604297   0.748 0.454552    
## 2005 - 1993 == 0 -0.0197221  0.3308996  -0.060 0.952473    
## 2006 - 1993 == 0  0.1177070  0.3650108   0.322 0.747093    
## 2007 - 1993 == 0 -0.0400295  0.3308996  -0.121 0.903713    
## 2010 - 1993 == 0 -0.0398195  0.3308996  -0.120 0.904216    
## 2014 - 1993 == 0 -0.1003684  0.3134807  -0.320 0.748836    
## 2015 - 1993 == 0 -0.0578798  0.3308996  -0.175 0.861145    
## 2016 - 1993 == 0 -0.3864257  0.3308996  -1.168 0.242886    
## 2017 - 1993 == 0 -0.2000589  0.3308996  -0.605 0.545451    
## 2018 - 1993 == 0 -0.2770119  0.3308996  -0.837 0.402509    
## 1995 - 1994 == 0  0.2801363  0.2942896   0.952 0.341144    
## 1997 - 1994 == 0  0.1339150  0.2634847   0.508 0.611281    
## 1998 - 1994 == 0 -0.4327261  0.3303441  -1.310 0.190221    
## 2000 - 1994 == 0 -0.4190984  0.2942896  -1.424 0.154417    
## 2001 - 1994 == 0 -0.4785099  0.3303297  -1.449 0.147454    
## 2002 - 1994 == 0 -0.3796492  0.2942896  -1.290 0.197032    
## 2003 - 1994 == 0 -0.3936484  0.2942896  -1.338 0.181020    
## 2004 - 1994 == 0 -0.0827241  0.3308996  -0.250 0.802589    
## 2005 - 1994 == 0 -0.3719925  0.2942896  -1.264 0.206217    
## 2006 - 1994 == 0 -0.2345634  0.3303297  -0.710 0.477649    
## 2007 - 1994 == 0 -0.3922999  0.2942896  -1.333 0.182519    
## 2010 - 1994 == 0 -0.3920899  0.2942896  -1.332 0.182753    
## 2014 - 1994 == 0 -0.4526388  0.2756729  -1.642 0.100602    
## 2015 - 1994 == 0 -0.4101502  0.2942896  -1.394 0.163409    
## 2016 - 1994 == 0 -0.7386961  0.2942896  -2.510 0.012070 *  
## 2017 - 1994 == 0 -0.5523293  0.2942896  -1.877 0.060543 .  
## 2018 - 1994 == 0 -0.6292823  0.2942896  -2.138 0.032492 *  
## 1997 - 1995 == 0 -0.1462213  0.2634847  -0.555 0.578928    
## 1998 - 1995 == 0 -0.7128624  0.3303441  -2.158 0.030933 *  
## 2000 - 1995 == 0 -0.6992348  0.2942896  -2.376 0.017501 *  
## 2001 - 1995 == 0 -0.7586462  0.3303297  -2.297 0.021640 *  
## 2002 - 1995 == 0 -0.6597855  0.2942896  -2.242 0.024964 *  
## 2003 - 1995 == 0 -0.6737847  0.2942896  -2.290 0.022049 *  
## 2004 - 1995 == 0 -0.3628604  0.3308996  -1.097 0.272822    
## 2005 - 1995 == 0 -0.6521288  0.2942896  -2.216 0.026695 *  
## 2006 - 1995 == 0 -0.5146997  0.3303297  -1.558 0.119200    
## 2007 - 1995 == 0 -0.6724363  0.2942896  -2.285 0.022316 *  
## 2010 - 1995 == 0 -0.6722262  0.2942896  -2.284 0.022358 *  
## 2014 - 1995 == 0 -0.7327752  0.2756729  -2.658 0.007857 ** 
## 2015 - 1995 == 0 -0.6902865  0.2942896  -2.346 0.018996 *  
## 2016 - 1995 == 0 -1.0188325  0.2942896  -3.462 0.000536 ***
## 2017 - 1995 == 0 -0.8324656  0.2942896  -2.829 0.004673 ** 
## 2018 - 1995 == 0 -0.9094186  0.2942896  -3.090 0.002000 ** 
## 1998 - 1997 == 0 -0.5666411  0.3020756  -1.876 0.060679 .  
## 2000 - 1997 == 0 -0.5530134  0.2634847  -2.099 0.035831 *  
## 2001 - 1997 == 0 -0.6124249  0.3035334  -2.018 0.043627 *  
## 2002 - 1997 == 0 -0.5135642  0.2634847  -1.949 0.051281 .  
## 2003 - 1997 == 0 -0.5275634  0.2634847  -2.002 0.045257 *  
## 2004 - 1997 == 0 -0.2166390  0.3046486  -0.711 0.477015    
## 2005 - 1997 == 0 -0.5059075  0.2634847  -1.920 0.054850 .  
## 2006 - 1997 == 0 -0.3684784  0.3035334  -1.214 0.224762    
## 2007 - 1997 == 0 -0.5262149  0.2634847  -1.997 0.045810 *  
## 2010 - 1997 == 0 -0.5260049  0.2634847  -1.996 0.045897 *  
## 2014 - 1997 == 0 -0.5865538  0.2423115  -2.421 0.015492 *  
## 2015 - 1997 == 0 -0.5440652  0.2634847  -2.065 0.038934 *  
## 2016 - 1997 == 0 -0.8726111  0.2634847  -3.312 0.000927 ***
## 2017 - 1997 == 0 -0.6862443  0.2634847  -2.604 0.009201 ** 
## 2018 - 1997 == 0 -0.7631973  0.2634847  -2.897 0.003773 ** 
## 2000 - 1998 == 0  0.0136276  0.3303441   0.041 0.967094    
## 2001 - 1998 == 0 -0.0457838  0.3634983  -0.126 0.899769    
## 2002 - 1998 == 0  0.0530769  0.3303441   0.161 0.872352    
## 2003 - 1998 == 0  0.0390777  0.3303441   0.118 0.905835    
## 2004 - 1998 == 0  0.3500020  0.3650499   0.959 0.337670    
## 2005 - 1998 == 0  0.0607336  0.3303441   0.184 0.854132    
## 2006 - 1998 == 0  0.1981627  0.3634983   0.545 0.585647    
## 2007 - 1998 == 0  0.0404261  0.3303441   0.122 0.902601    
## 2010 - 1998 == 0  0.0406362  0.3303441   0.123 0.902098    
## 2014 - 1998 == 0 -0.0199128  0.3134807  -0.064 0.949351    
## 2015 - 1998 == 0  0.0225758  0.3303441   0.068 0.945515    
## 2016 - 1998 == 0 -0.3059701  0.3303441  -0.926 0.354334    
## 2017 - 1998 == 0 -0.1196032  0.3303441  -0.362 0.717310    
## 2018 - 1998 == 0 -0.1965562  0.3303441  -0.595 0.551841    
## 2001 - 2000 == 0 -0.0594115  0.3303297  -0.180 0.857266    
## 2002 - 2000 == 0  0.0394492  0.2942896   0.134 0.893364    
## 2003 - 2000 == 0  0.0254501  0.2942896   0.086 0.931085    
## 2004 - 2000 == 0  0.3363744  0.3308996   1.017 0.309370    
## 2005 - 2000 == 0  0.0471059  0.2942896   0.160 0.872829    
## 2006 - 2000 == 0  0.1845351  0.3303297   0.559 0.576408    
## 2007 - 2000 == 0  0.0267985  0.2942896   0.091 0.927444    
## 2010 - 2000 == 0  0.0270086  0.2942896   0.092 0.926876    
## 2014 - 2000 == 0 -0.0335404  0.2756729  -0.122 0.903162    
## 2015 - 2000 == 0  0.0089482  0.2942896   0.030 0.975743    
## 2016 - 2000 == 0 -0.3195977  0.2942896  -1.086 0.277480    
## 2017 - 2000 == 0 -0.1332308  0.2942896  -0.453 0.650750    
## 2018 - 2000 == 0 -0.2101838  0.2942896  -0.714 0.475099    
## 2002 - 2001 == 0  0.0988607  0.3303297   0.299 0.764727    
## 2003 - 2001 == 0  0.0848615  0.3303297   0.257 0.797256    
## 2004 - 2001 == 0  0.3957859  0.3650108   1.084 0.278226    
## 2005 - 2001 == 0  0.1065174  0.3303297   0.322 0.747106    
## 2006 - 2001 == 0  0.2439465  0.3604297   0.677 0.498519    
## 2007 - 2001 == 0  0.0862100  0.3303297   0.261 0.794107    
## 2010 - 2001 == 0  0.0864200  0.3303297   0.262 0.793616    
## 2014 - 2001 == 0  0.0258711  0.3152247   0.082 0.934590    
## 2015 - 2001 == 0  0.0683597  0.3303297   0.207 0.836054    
## 2016 - 2001 == 0 -0.2601862  0.3303297  -0.788 0.430898    
## 2017 - 2001 == 0 -0.0738194  0.3303297  -0.223 0.823168    
## 2018 - 2001 == 0 -0.1507724  0.3303297  -0.456 0.648081    
## 2003 - 2002 == 0 -0.0139992  0.2942896  -0.048 0.962059    
## 2004 - 2002 == 0  0.2969252  0.3308996   0.897 0.369544    
## 2005 - 2002 == 0  0.0076567  0.2942896   0.026 0.979243    
## 2006 - 2002 == 0  0.1450858  0.3303297   0.439 0.660506    
## 2007 - 2002 == 0 -0.0126507  0.2942896  -0.043 0.965712    
## 2010 - 2002 == 0 -0.0124407  0.2942896  -0.042 0.966281    
## 2014 - 2002 == 0 -0.0729896  0.2756729  -0.265 0.791187    
## 2015 - 2002 == 0 -0.0305010  0.2942896  -0.104 0.917453    
## 2016 - 2002 == 0 -0.3590469  0.2942896  -1.220 0.222447    
## 2017 - 2002 == 0 -0.1726801  0.2942896  -0.587 0.557359    
## 2018 - 2002 == 0 -0.2496331  0.2942896  -0.848 0.396295    
## 2004 - 2003 == 0  0.3109243  0.3308996   0.940 0.347406    
## 2005 - 2003 == 0  0.0216559  0.2942896   0.074 0.941339    
## 2006 - 2003 == 0  0.1590850  0.3303297   0.482 0.630094    
## 2007 - 2003 == 0  0.0013484  0.2942896   0.005 0.996344    
## 2010 - 2003 == 0  0.0015585  0.2942896   0.005 0.995775    
## 2014 - 2003 == 0 -0.0589905  0.2756729  -0.214 0.830557    
## 2015 - 2003 == 0 -0.0165019  0.2942896  -0.056 0.955283    
## 2016 - 2003 == 0 -0.3450478  0.2942896  -1.172 0.241006    
## 2017 - 2003 == 0 -0.1586809  0.2942896  -0.539 0.589749    
## 2018 - 2003 == 0 -0.2356339  0.2942896  -0.801 0.423313    
## 2005 - 2004 == 0 -0.2892685  0.3308996  -0.874 0.382016    
## 2006 - 2004 == 0 -0.1518393  0.3650108  -0.416 0.677420    
## 2007 - 2004 == 0 -0.3095759  0.3308996  -0.936 0.349501    
## 2010 - 2004 == 0 -0.3093658  0.3308996  -0.935 0.349828    
## 2014 - 2004 == 0 -0.3699148  0.3134807  -1.180 0.237991    
## 2015 - 2004 == 0 -0.3274262  0.3308996  -0.990 0.322417    
## 2016 - 2004 == 0 -0.6559721  0.3308996  -1.982 0.047436 *  
## 2017 - 2004 == 0 -0.4696052  0.3308996  -1.419 0.155847    
## 2018 - 2004 == 0 -0.5465582  0.3308996  -1.652 0.098589 .  
## 2006 - 2005 == 0  0.1374291  0.3303297   0.416 0.677384    
## 2007 - 2005 == 0 -0.0203074  0.2942896  -0.069 0.944986    
## 2010 - 2005 == 0 -0.0200974  0.2942896  -0.068 0.945554    
## 2014 - 2005 == 0 -0.0806463  0.2756729  -0.293 0.769871    
## 2015 - 2005 == 0 -0.0381577  0.2942896  -0.130 0.896835    
## 2016 - 2005 == 0 -0.3667036  0.2942896  -1.246 0.212741    
## 2017 - 2005 == 0 -0.1803368  0.2942896  -0.613 0.540017    
## 2018 - 2005 == 0 -0.2572898  0.2942896  -0.874 0.381969    
## 2007 - 2006 == 0 -0.1577366  0.3303297  -0.478 0.632997    
## 2010 - 2006 == 0 -0.1575265  0.3303297  -0.477 0.633450    
## 2014 - 2006 == 0 -0.2180754  0.3152247  -0.692 0.489057    
## 2015 - 2006 == 0 -0.1755868  0.3303297  -0.532 0.595038    
## 2016 - 2006 == 0 -0.5041327  0.3303297  -1.526 0.126972    
## 2017 - 2006 == 0 -0.3177659  0.3303297  -0.962 0.336067    
## 2018 - 2006 == 0 -0.3947189  0.3303297  -1.195 0.232117    
## 2010 - 2007 == 0  0.0002101  0.2942896   0.001 0.999431    
## 2014 - 2007 == 0 -0.0603389  0.2756729  -0.219 0.826745    
## 2015 - 2007 == 0 -0.0178503  0.2942896  -0.061 0.951634    
## 2016 - 2007 == 0 -0.3463962  0.2942896  -1.177 0.239172    
## 2017 - 2007 == 0 -0.1600293  0.2942896  -0.544 0.586592    
## 2018 - 2007 == 0 -0.2369823  0.2942896  -0.805 0.420664    
## 2014 - 2010 == 0 -0.0605489  0.2756729  -0.220 0.826151    
## 2015 - 2010 == 0 -0.0180603  0.2942896  -0.061 0.951065    
## 2016 - 2010 == 0 -0.3466062  0.2942896  -1.178 0.238887    
## 2017 - 2010 == 0 -0.1602394  0.2942896  -0.544 0.586101    
## 2018 - 2010 == 0 -0.2371924  0.2942896  -0.806 0.420253    
## 2015 - 2014 == 0  0.0424886  0.2756729   0.154 0.877510    
## 2016 - 2014 == 0 -0.2860573  0.2756729  -1.038 0.299424    
## 2017 - 2014 == 0 -0.0996904  0.2756729  -0.362 0.717632    
## 2018 - 2014 == 0 -0.1766434  0.2756729  -0.641 0.521671    
## 2016 - 2015 == 0 -0.3285459  0.2942896  -1.116 0.264250    
## 2017 - 2015 == 0 -0.1421790  0.2942896  -0.483 0.629006    
## 2018 - 2015 == 0 -0.2191321  0.2942896  -0.745 0.456505    
## 2017 - 2016 == 0  0.1863669  0.2942896   0.633 0.526553    
## 2018 - 2016 == 0  0.1094139  0.2942896   0.372 0.710049    
## 2018 - 2017 == 0 -0.0769530  0.2942896  -0.261 0.793717    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## (Univariate p values reported)

Model 4 plot (Massives, significant)

 Model4_All<-grid.arrange(massives_plot, model4_plot, ncol=2)

Aggregate data (Millepora)

  • Hierarchically aggregate by location
# Aggregate by Location
  aggr.location.mill <- aggregate(Millepora ~ YEAR+Month+Location, 
                        FUN=mean,data=cover)
  aggr.location.mill$Year_F<-as.factor(aggr.location.mill$YEAR)

Millepora model (5)

This model includes aggregated data from Chiriqui

  • Aggregated by location
  • YEAR is continuous
  • Location as a random factor

Model is NOT significant

# All years 1980_2018 
  Model5 <- lme(Millepora ~ YEAR, random = ~1|Location, data=aggr.location.mill)
  summary(Model5)
## Linear mixed-effects model fit by REML
##   Data: aggr.location.mill 
##        AIC      BIC   logLik
##   380.9101 390.7275 -186.455
## 
## Random effects:
##  Formula: ~1 | Location
##         (Intercept) Residual
## StdDev:    1.029795 1.903698
## 
## Fixed effects:  Millepora ~ YEAR 
##                Value Std.Error DF   t-value p-value
## (Intercept) 56.36099  37.44453 84  1.505186  0.1360
## YEAR        -0.02791   0.01873 84 -1.490502  0.1398
##  Correlation: 
##      (Intr)
## YEAR -1    
## 
## Standardized Within-Group Residuals:
##         Min          Q1         Med          Q3         Max 
## -0.89098680 -0.19761334 -0.11252735  0.08986138  6.63015422 
## 
## Number of Observations: 88
## Number of Groups: 3
  anova(Model5)
  #plot(ranef(Model5))    # Symmetrical scatter effects around zero?
  #plot(Model5)           # plot residuals vs fitted
  #resnorm1 <- resid(Model5)
  #hist(resnorm1, xlab = "Residuals", main = "") # are residuals normally distributed?
  #coef.m1 <- as.data.frame(coef(summary(Model5)))    # Coefficients of the model
  
  #plot(Model5, resid(., type = "p") ~ fitted(.) | Location, abline = 0)
  #plot(Model5, Millepora ~ fitted(.), abline = c(0,1))

Millepora model 6 (multiple comparisons between years)

This model includes data from Chiriqui * aggregated by location * Year is a factor * location as a random factor

# All years 1980_2018 
  Model6 <- lme(
    Millepora ~ -1 + Year_F, random = ~1|Location, data=aggr.location.mill)
  #summary(Model6)
  anova(Model6)

Millepora plots (non-significant models)

Aggregate data (aal Scleractinians)

  • Hierarchically aggregate by location
# Aggregate by Location
  aggr.location.scl <- aggregate(All_Corals ~ YEAR+Month+Location, 
                        FUN=mean,data=cover)
  aggr.location.scl$Year_F<-as.factor(aggr.location.scl$YEAR)

All scleractinians (model 7)

This model includes aggregated data from Chiriqui

  • Aggregated by location
  • YEAR as a continuous variable
  • Location as a random factor

Model is significant

# All years 1980_2018 
  Model7 <- lme(All_Corals ~ YEAR, random = ~1|Location, data=aggr.location.scl)
  summary(Model7)
## Linear mixed-effects model fit by REML
##   Data: aggr.location.scl 
##        AIC      BIC    logLik
##   736.0592 745.9228 -364.0296
## 
## Random effects:
##  Formula: ~1 | Location
##         (Intercept) Residual
## StdDev:    9.305161 14.25379
## 
## Fixed effects:  All_Corals ~ YEAR 
##                  Value Std.Error DF   t-value p-value
## (Intercept) -2968.1770 277.83805 85 -10.68312       0
## YEAR            1.4963   0.13896 85  10.76830       0
##  Correlation: 
##      (Intr)
## YEAR -1    
## 
## Standardized Within-Group Residuals:
##        Min         Q1        Med         Q3        Max 
## -1.4066083 -0.6279905 -0.2874973  0.4839908  5.2554719 
## 
## Number of Observations: 89
## Number of Groups: 3
  anova(Model7)
  plot(ranef(Model7))    # Symmetrical scatter effects around zero?
  plot(Model7)           # plot residuals vs fitted
  resnorm1 <- resid(Model7)
  hist(resnorm1, xlab = "Residuals", main = "") # are residuals normally distributed?
  coef.m1 <- as.data.frame(coef(summary(Model7)))    # Coefficients of the model
  
  plot(Model7, resid(., type = "p") ~ fitted(.) | Location, abline = 0)
  plot(Model7, All_Corals ~ fitted(.), abline = c(0,1))

Model 7 plot

Scleractinian_plot <- ggplot(aggr.location.scl, 
                             aes(x=YEAR, y=All_Corals)) +
  #geom_boxplot(aes(group=YEAR), outlier.shape = NA) +
  #stat_boxplot(aes(group=YEAR), geom = 'errorbar')+
  geom_point(aes(fill=factor(Location)),
                 shape = 21, colour = "black",
                 size = 2, stroke = 0.8, alpha=0.5) +
  geom_smooth(method = lm, se=FALSE, linetype = "dashed", colour="red")+
  geom_smooth(span = 0.3, se=T, colour="darkgray")+ 
  scale_y_continuous("Coral cover (%)", limits = c(-0.5, 80), expand = c(0,0))+
  scale_x_continuous("", limits = c(1979, 2019),
                     breaks = seq(1979, 2019, by=2), expand = c(0,0))+
  annotate("rect", xmin = 1982, xmax = 1983, 
           ymin = 0, ymax = 80,  alpha = .2, fill="gray")+
  annotate("rect", xmin = 1997, xmax = 1998, 
           ymin = 0, ymax = 80,  alpha = .2, fill="gray")+
  annotate("rect", xmin = 2015, xmax = 2016,
           ymin = 0, ymax = 80,  alpha = .2, fill="gray")

Scleractinian_plot + theme(legend.position = c(0.25, 0.8))

Scleractinians model 8 (multiple comparisons between years)

This model includes data from Chiriqui

  • Aggregated by location
  • Year as a factor
  • Location as a random factor
# All years 1980_2018 
  Model8 <- lme(
    All_Corals ~ -1 + Year_F, random = ~1|Location, data=aggr.location.scl)
  #summary(Model8)
  anova(Model8)
  plot(ranef(Model8))    # Symmetrical scatter effects around zero?
  plot(Model8)           # plot residuals vs fitted
  resnorm1 <- resid(Model8)
  hist(resnorm1, xlab = "Residuals", main = "") # are residuals normally distributed?
  coef.m1 <- as.data.frame(coef(summary(Model8)))    # Coefficients of the model
  
  plot(Model8, resid(., type = "p") ~ fitted(.) | Location, abline = 0)
  plot(Model8, All_Corals ~ fitted(.), abline = c(0,1))
  
  # Multicomp
    Year_F.emm_scle<-emmeans(Model8, ~Year_F)
    #contrast(Year_F.emm, "tukey")
    year_groups_Scle<-cld(Year_F.emm_scle, by=NULL) # compact-letter display
    year_groups_Scle

Model 8 plot data

Model 8 plot

# Effect plot
  Model8_predictoin<-plot(emmeans(Model8, ~Year_F), comparisons = TRUE) +
      coord_flip(xlim = NULL, ylim = NULL, expand = TRUE) + theme_bw()+
    theme(axis.text.x = element_text(angle = 90)) + 
    ggtitle("Model 8 predictions (All scleractinians)")
 Model8_All<-grid.arrange(Scleractinian_plot, Model8_predictoin, ncol=2)

Summary:

  • Pretty much same as only Pocillopora …

  • 1980 is different from 1983-2001 -> Coral cover lose after 1981-82 ENSO
  • “Recovery” by 2002 (no differences between 1980 and 2002) uninterrupted until 2018 -> no significant cover loss in 1997-98 nor 2015-16
  • 1997 not different from 1998, 2000, 2001, 2003
  • 2015 not different from 2016, 2017, 2018

m.comp_sclera <- glht(Model8, linfct = mcp(Year_F = "Tukey"))
summary(m.comp_sclera, test = univariate())
## 
##   Simultaneous Tests for General Linear Hypotheses
## 
## Multiple Comparisons of Means: Tukey Contrasts
## 
## 
## Fit: lme.formula(fixed = All_Corals ~ -1 + Year_F, data = aggr.location.scl, 
##     random = ~1 | Location)
## 
## Linear Hypotheses:
##                  Estimate Std. Error z value Pr(>|z|)    
## 1983 - 1980 == 0 -28.4449    10.9569  -2.596 0.009429 ** 
## 1984 - 1980 == 0 -52.4880     9.5926  -5.472 4.46e-08 ***
## 1985 - 1980 == 0 -50.0054     9.4288  -5.303 1.14e-07 ***
## 1986 - 1980 == 0 -44.5140    11.8884  -3.744 0.000181 ***
## 1987 - 1980 == 0 -44.1940    11.8884  -3.717 0.000201 ***
## 1988 - 1980 == 0 -43.2755    11.8884  -3.640 0.000272 ***
## 1989 - 1980 == 0 -47.6867    10.8642  -4.389 1.14e-05 ***
## 1990 - 1980 == 0 -46.5527    10.8642  -4.285 1.83e-05 ***
## 1992 - 1980 == 0 -41.2590    11.8884  -3.471 0.000519 ***
## 1993 - 1980 == 0 -40.3945    11.8884  -3.398 0.000679 ***
## 1994 - 1980 == 0 -40.0334    10.9116  -3.669 0.000244 ***
## 1995 - 1980 == 0 -31.1317    10.9116  -2.853 0.004330 ** 
## 1997 - 1980 == 0 -28.5771    10.0439  -2.845 0.004438 ** 
## 1998 - 1980 == 0 -30.6908    12.0336  -2.550 0.010759 *  
## 2000 - 1980 == 0 -26.2621    10.9116  -2.407 0.016093 *  
## 2001 - 1980 == 0 -25.6681    12.0324  -2.133 0.032904 *  
## 2002 - 1980 == 0 -16.8724    10.9116  -1.546 0.122036    
## 2003 - 1980 == 0 -14.5042    10.9116  -1.329 0.183767    
## 2004 - 1980 == 0  -8.6560    11.8884  -0.728 0.466550    
## 2005 - 1980 == 0 -10.9193    10.9116  -1.001 0.316969    
## 2006 - 1980 == 0  -2.5322    12.0324  -0.210 0.833319    
## 2007 - 1980 == 0  -7.5524    10.9116  -0.692 0.488844    
## 2010 - 1980 == 0  -2.5647    10.9116  -0.235 0.814176    
## 2014 - 1980 == 0  -3.2670    10.3377  -0.316 0.751980    
## 2015 - 1980 == 0   1.8466    10.9116   0.169 0.865614    
## 2016 - 1980 == 0  -6.2235    10.9116  -0.570 0.568434    
## 2017 - 1980 == 0   8.7399    10.9116   0.801 0.423147    
## 2018 - 1980 == 0  10.2211    10.9116   0.937 0.348903    
## 1984 - 1983 == 0 -24.0431     8.6015  -2.795 0.005186 ** 
## 1985 - 1983 == 0 -21.5604     8.3604  -2.579 0.009912 ** 
## 1986 - 1983 == 0 -16.0691    10.9569  -1.467 0.142492    
## 1987 - 1983 == 0 -15.7491    10.9569  -1.437 0.150613    
## 1988 - 1983 == 0 -14.8306    10.9569  -1.354 0.175883    
## 1989 - 1983 == 0 -19.2417     9.9129  -1.941 0.052249 .  
## 1990 - 1983 == 0 -18.1077     9.9129  -1.827 0.067748 .  
## 1992 - 1983 == 0 -12.8140    10.9569  -1.169 0.242202    
## 1993 - 1983 == 0 -11.9496    10.9569  -1.091 0.275449    
## 1994 - 1983 == 0 -11.5885     9.8875  -1.172 0.241184    
## 1995 - 1983 == 0  -2.6868     9.8875  -0.272 0.785827    
## 1997 - 1983 == 0  -0.1321     8.8694  -0.015 0.988114    
## 1998 - 1983 == 0  -2.2459    11.0101  -0.204 0.838367    
## 2000 - 1983 == 0   2.1828     9.8875   0.221 0.825274    
## 2001 - 1983 == 0   2.7769    11.2135   0.248 0.804418    
## 2002 - 1983 == 0  11.5725     9.8875   1.170 0.241832    
## 2003 - 1983 == 0  13.9407     9.8875   1.410 0.158559    
## 2004 - 1983 == 0  19.7889    10.9569   1.806 0.070906 .  
## 2005 - 1983 == 0  17.5257     9.8875   1.773 0.076311 .  
## 2006 - 1983 == 0  25.9128    11.2135   2.311 0.020841 *  
## 2007 - 1983 == 0  20.8925     9.8875   2.113 0.034599 *  
## 2010 - 1983 == 0  25.8803     9.8875   2.617 0.008858 ** 
## 2014 - 1983 == 0  25.1779     9.1889   2.740 0.006143 ** 
## 2015 - 1983 == 0  30.2915     9.8875   3.064 0.002187 ** 
## 2016 - 1983 == 0  22.2214     9.8875   2.247 0.024613 *  
## 2017 - 1983 == 0  37.1848     9.8875   3.761 0.000169 ***
## 2018 - 1983 == 0  38.6660     9.8875   3.911 9.21e-05 ***
## 1985 - 1984 == 0   2.4826     6.1613   0.403 0.686993    
## 1986 - 1984 == 0   7.9740     9.5926   0.831 0.405822    
## 1987 - 1984 == 0   8.2940     9.5926   0.865 0.387243    
## 1988 - 1984 == 0   9.2125     9.5926   0.960 0.336865    
## 1989 - 1984 == 0   4.8014     8.2239   0.584 0.559334    
## 1990 - 1984 == 0   5.9353     8.2239   0.722 0.470465    
## 1992 - 1984 == 0  11.2290     9.5926   1.171 0.241762    
## 1993 - 1984 == 0  12.0935     9.5926   1.261 0.207412    
## 1994 - 1984 == 0  12.4546     8.3522   1.491 0.135918    
## 1995 - 1984 == 0  21.3563     8.3522   2.557 0.010559 *  
## 1997 - 1984 == 0  23.9110     7.2269   3.309 0.000938 ***
## 1998 - 1984 == 0  21.7972     9.8557   2.212 0.026992 *  
## 2000 - 1984 == 0  26.2259     8.3522   3.140 0.001690 ** 
## 2001 - 1984 == 0  26.8199     9.6880   2.768 0.005634 ** 
## 2002 - 1984 == 0  35.6156     8.3522   4.264 2.01e-05 ***
## 2003 - 1984 == 0  37.9838     8.3522   4.548 5.42e-06 ***
## 2004 - 1984 == 0  43.8320     9.5926   4.569 4.89e-06 ***
## 2005 - 1984 == 0  41.5688     8.3522   4.977 6.46e-07 ***
## 2006 - 1984 == 0  49.9558     9.6880   5.156 2.52e-07 ***
## 2007 - 1984 == 0  44.9356     8.3522   5.380 7.45e-08 ***
## 2010 - 1984 == 0  49.9233     8.3522   5.977 2.27e-09 ***
## 2014 - 1984 == 0  49.2210     7.6403   6.442 1.18e-10 ***
## 2015 - 1984 == 0  54.3346     8.3522   6.505 7.75e-11 ***
## 2016 - 1984 == 0  46.2645     8.3522   5.539 3.04e-08 ***
## 2017 - 1984 == 0  61.2279     8.3522   7.331 2.29e-13 ***
## 2018 - 1984 == 0  62.7091     8.3522   7.508 6.00e-14 ***
## 1986 - 1985 == 0   5.4914     9.4288   0.582 0.560293    
## 1987 - 1985 == 0   5.8114     9.4288   0.616 0.537667    
## 1988 - 1985 == 0   6.7299     9.4288   0.714 0.475376    
## 1989 - 1985 == 0   2.3187     8.0524   0.288 0.773383    
## 1990 - 1985 == 0   3.4527     8.0524   0.429 0.668083    
## 1992 - 1985 == 0   8.7464     9.4288   0.928 0.353602    
## 1993 - 1985 == 0   9.6109     9.4288   1.019 0.308055    
## 1994 - 1985 == 0   9.9720     8.1634   1.222 0.221877    
## 1995 - 1985 == 0  18.8737     8.1634   2.312 0.020778 *  
## 1997 - 1985 == 0  21.4283     6.9938   3.064 0.002185 ** 
## 1998 - 1985 == 0  19.3146     9.6709   1.997 0.045804 *  
## 2000 - 1985 == 0  23.7433     8.1634   2.909 0.003631 ** 
## 2001 - 1985 == 0  24.3373     9.5511   2.548 0.010831 *  
## 2002 - 1985 == 0  33.1330     8.1634   4.059 4.93e-05 ***
## 2003 - 1985 == 0  35.5012     8.1634   4.349 1.37e-05 ***
## 2004 - 1985 == 0  41.3494     9.4288   4.385 1.16e-05 ***
## 2005 - 1985 == 0  39.0861     8.1634   4.788 1.68e-06 ***
## 2006 - 1985 == 0  47.4732     9.5511   4.970 6.68e-07 ***
## 2007 - 1985 == 0  42.4530     8.1634   5.200 1.99e-07 ***
## 2010 - 1985 == 0  47.4407     8.1634   5.811 6.19e-09 ***
## 2014 - 1985 == 0  46.7384     7.4170   6.301 2.95e-10 ***
## 2015 - 1985 == 0  51.8520     8.1634   6.352 2.13e-10 ***
## 2016 - 1985 == 0  43.7819     8.1634   5.363 8.18e-08 ***
## 2017 - 1985 == 0  58.7453     8.1634   7.196 6.19e-13 ***
## 2018 - 1985 == 0  60.2265     8.1634   7.378 1.61e-13 ***
## 1987 - 1986 == 0   0.3200    11.8884   0.027 0.978526    
## 1988 - 1986 == 0   1.2385    11.8884   0.104 0.917029    
## 1989 - 1986 == 0  -3.1727    10.8642  -0.292 0.770263    
## 1990 - 1986 == 0  -2.0387    10.8642  -0.188 0.851150    
## 1992 - 1986 == 0   3.2550    11.8884   0.274 0.784241    
## 1993 - 1986 == 0   4.1195    11.8884   0.347 0.728956    
## 1994 - 1986 == 0   4.4806    10.9116   0.411 0.681348    
## 1995 - 1986 == 0  13.3823    10.9116   1.226 0.220038    
## 1997 - 1986 == 0  15.9369    10.0439   1.587 0.112573    
## 1998 - 1986 == 0  13.8232    12.0336   1.149 0.250672    
## 2000 - 1986 == 0  18.2519    10.9116   1.673 0.094385 .  
## 2001 - 1986 == 0  18.8459    12.0324   1.566 0.117287    
## 2002 - 1986 == 0  27.6416    10.9116   2.533 0.011302 *  
## 2003 - 1986 == 0  30.0098    10.9116   2.750 0.005955 ** 
## 2004 - 1986 == 0  35.8580    11.8884   3.016 0.002560 ** 
## 2005 - 1986 == 0  33.5947    10.9116   3.079 0.002078 ** 
## 2006 - 1986 == 0  41.9818    12.0324   3.489 0.000485 ***
## 2007 - 1986 == 0  36.9616    10.9116   3.387 0.000706 ***
## 2010 - 1986 == 0  41.9493    10.9116   3.844 0.000121 ***
## 2014 - 1986 == 0  41.2470    10.3377   3.990 6.61e-05 ***
## 2015 - 1986 == 0  46.3606    10.9116   4.249 2.15e-05 ***
## 2016 - 1986 == 0  38.2905    10.9116   3.509 0.000450 ***
## 2017 - 1986 == 0  53.2539    10.9116   4.880 1.06e-06 ***
## 2018 - 1986 == 0  54.7351    10.9116   5.016 5.27e-07 ***
## 1988 - 1987 == 0   0.9185    11.8884   0.077 0.938417    
## 1989 - 1987 == 0  -3.4927    10.8642  -0.321 0.747843    
## 1990 - 1987 == 0  -2.3587    10.8642  -0.217 0.828126    
## 1992 - 1987 == 0   2.9350    11.8884   0.247 0.805002    
## 1993 - 1987 == 0   3.7995    11.8884   0.320 0.749274    
## 1994 - 1987 == 0   4.1606    10.9116   0.381 0.702983    
## 1995 - 1987 == 0  13.0623    10.9116   1.197 0.231267    
## 1997 - 1987 == 0  15.6169    10.0439   1.555 0.119976    
## 1998 - 1987 == 0  13.5032    12.0336   1.122 0.261808    
## 2000 - 1987 == 0  17.9319    10.9116   1.643 0.100304    
## 2001 - 1987 == 0  18.5259    12.0324   1.540 0.123641    
## 2002 - 1987 == 0  27.3216    10.9116   2.504 0.012283 *  
## 2003 - 1987 == 0  29.6898    10.9116   2.721 0.006510 ** 
## 2004 - 1987 == 0  35.5380    11.8884   2.989 0.002796 ** 
## 2005 - 1987 == 0  33.2747    10.9116   3.049 0.002292 ** 
## 2006 - 1987 == 0  41.6618    12.0324   3.462 0.000535 ***
## 2007 - 1987 == 0  36.6416    10.9116   3.358 0.000785 ***
## 2010 - 1987 == 0  41.6293    10.9116   3.815 0.000136 ***
## 2014 - 1987 == 0  40.9270    10.3377   3.959 7.53e-05 ***
## 2015 - 1987 == 0  46.0406    10.9116   4.219 2.45e-05 ***
## 2016 - 1987 == 0  37.9705    10.9116   3.480 0.000502 ***
## 2017 - 1987 == 0  52.9339    10.9116   4.851 1.23e-06 ***
## 2018 - 1987 == 0  54.4151    10.9116   4.987 6.14e-07 ***
## 1989 - 1988 == 0  -4.4112    10.8642  -0.406 0.684722    
## 1990 - 1988 == 0  -3.2772    10.8642  -0.302 0.762919    
## 1992 - 1988 == 0   2.0165    11.8884   0.170 0.865310    
## 1993 - 1988 == 0   2.8810    11.8884   0.242 0.808519    
## 1994 - 1988 == 0   3.2421    10.9116   0.297 0.766374    
## 1995 - 1988 == 0  12.1438    10.9116   1.113 0.265741    
## 1997 - 1988 == 0  14.6984    10.0439   1.463 0.143351    
## 1998 - 1988 == 0  12.5847    12.0336   1.046 0.295654    
## 2000 - 1988 == 0  17.0134    10.9116   1.559 0.118948    
## 2001 - 1988 == 0  17.6074    12.0324   1.463 0.143376    
## 2002 - 1988 == 0  26.4031    10.9116   2.420 0.015532 *  
## 2003 - 1988 == 0  28.7713    10.9116   2.637 0.008370 ** 
## 2004 - 1988 == 0  34.6195    11.8884   2.912 0.003591 ** 
## 2005 - 1988 == 0  32.3562    10.9116   2.965 0.003024 ** 
## 2006 - 1988 == 0  40.7433    12.0324   3.386 0.000709 ***
## 2007 - 1988 == 0  35.7231    10.9116   3.274 0.001061 ** 
## 2010 - 1988 == 0  40.7108    10.9116   3.731 0.000191 ***
## 2014 - 1988 == 0  40.0085    10.3377   3.870 0.000109 ***
## 2015 - 1988 == 0  45.1221    10.9116   4.135 3.55e-05 ***
## 2016 - 1988 == 0  37.0520    10.9116   3.396 0.000685 ***
## 2017 - 1988 == 0  52.0154    10.9116   4.767 1.87e-06 ***
## 2018 - 1988 == 0  53.4966    10.9116   4.903 9.45e-07 ***
## 1990 - 1989 == 0   1.1340     9.7068   0.117 0.906999    
## 1992 - 1989 == 0   6.4277    10.8642   0.592 0.554093    
## 1993 - 1989 == 0   7.2922    10.8642   0.671 0.502086    
## 1994 - 1989 == 0   7.6532     9.7860   0.782 0.434180    
## 1995 - 1989 == 0  16.5550     9.7860   1.692 0.090704 .  
## 1997 - 1989 == 0  19.1096     8.8253   2.165 0.030364 *  
## 1998 - 1989 == 0  16.9959    11.0576   1.537 0.124286    
## 2000 - 1989 == 0  21.4246     9.7860   2.189 0.028575 *  
## 2001 - 1989 == 0  22.0186    10.9876   2.004 0.045075 *  
## 2002 - 1989 == 0  30.8143     9.7860   3.149 0.001639 ** 
## 2003 - 1989 == 0  33.1825     9.7860   3.391 0.000697 ***
## 2004 - 1989 == 0  39.0307    10.8642   3.593 0.000327 ***
## 2005 - 1989 == 0  36.7674     9.7860   3.757 0.000172 ***
## 2006 - 1989 == 0  45.1545    10.9876   4.110 3.96e-05 ***
## 2007 - 1989 == 0  40.1342     9.7860   4.101 4.11e-05 ***
## 2010 - 1989 == 0  45.1220     9.7860   4.611 4.01e-06 ***
## 2014 - 1989 == 0  44.4196     9.1624   4.848 1.25e-06 ***
## 2015 - 1989 == 0  49.5333     9.7860   5.062 4.16e-07 ***
## 2016 - 1989 == 0  41.4632     9.7860   4.237 2.27e-05 ***
## 2017 - 1989 == 0  56.4266     9.7860   5.766 8.12e-09 ***
## 2018 - 1989 == 0  57.9078     9.7860   5.917 3.27e-09 ***
## 1992 - 1990 == 0   5.2937    10.8642   0.487 0.626075    
## 1993 - 1990 == 0   6.1582    10.8642   0.567 0.570829    
## 1994 - 1990 == 0   6.5192     9.7860   0.666 0.505296    
## 1995 - 1990 == 0  15.4210     9.7860   1.576 0.115068    
## 1997 - 1990 == 0  17.9756     8.8253   2.037 0.041668 *  
## 1998 - 1990 == 0  15.8619    11.0576   1.434 0.151437    
## 2000 - 1990 == 0  20.2906     9.7860   2.073 0.038133 *  
## 2001 - 1990 == 0  20.8846    10.9876   1.901 0.057335 .  
## 2002 - 1990 == 0  29.6803     9.7860   3.033 0.002422 ** 
## 2003 - 1990 == 0  32.0485     9.7860   3.275 0.001057 ** 
## 2004 - 1990 == 0  37.8967    10.8642   3.488 0.000486 ***
## 2005 - 1990 == 0  35.6334     9.7860   3.641 0.000271 ***
## 2006 - 1990 == 0  44.0205    10.9876   4.006 6.17e-05 ***
## 2007 - 1990 == 0  39.0002     9.7860   3.985 6.74e-05 ***
## 2010 - 1990 == 0  43.9880     9.7860   4.495 6.96e-06 ***
## 2014 - 1990 == 0  43.2856     9.1624   4.724 2.31e-06 ***
## 2015 - 1990 == 0  48.3993     9.7860   4.946 7.58e-07 ***
## 2016 - 1990 == 0  40.3292     9.7860   4.121 3.77e-05 ***
## 2017 - 1990 == 0  55.2926     9.7860   5.650 1.60e-08 ***
## 2018 - 1990 == 0  56.7738     9.7860   5.802 6.57e-09 ***
## 1993 - 1992 == 0   0.8645    11.8884   0.073 0.942031    
## 1994 - 1992 == 0   1.2256    10.9116   0.112 0.910572    
## 1995 - 1992 == 0  10.1273    10.9116   0.928 0.353344    
## 1997 - 1992 == 0  12.6819    10.0439   1.263 0.206713    
## 1998 - 1992 == 0  10.5682    12.0336   0.878 0.379821    
## 2000 - 1992 == 0  14.9969    10.9116   1.374 0.169318    
## 2001 - 1992 == 0  15.5909    12.0324   1.296 0.195064    
## 2002 - 1992 == 0  24.3866    10.9116   2.235 0.025422 *  
## 2003 - 1992 == 0  26.7548    10.9116   2.452 0.014208 *  
## 2004 - 1992 == 0  32.6030    11.8884   2.742 0.006099 ** 
## 2005 - 1992 == 0  30.3397    10.9116   2.781 0.005427 ** 
## 2006 - 1992 == 0  38.7268    12.0324   3.219 0.001288 ** 
## 2007 - 1992 == 0  33.7066    10.9116   3.089 0.002008 ** 
## 2010 - 1992 == 0  38.6943    10.9116   3.546 0.000391 ***
## 2014 - 1992 == 0  37.9920    10.3377   3.675 0.000238 ***
## 2015 - 1992 == 0  43.1056    10.9116   3.950 7.80e-05 ***
## 2016 - 1992 == 0  35.0355    10.9116   3.211 0.001323 ** 
## 2017 - 1992 == 0  49.9989    10.9116   4.582 4.60e-06 ***
## 2018 - 1992 == 0  51.4801    10.9116   4.718 2.38e-06 ***
## 1994 - 1993 == 0   0.3611    10.9116   0.033 0.973603    
## 1995 - 1993 == 0   9.2628    10.9116   0.849 0.395940    
## 1997 - 1993 == 0  11.8174    10.0439   1.177 0.239362    
## 1998 - 1993 == 0   9.7037    12.0336   0.806 0.420021    
## 2000 - 1993 == 0  14.1324    10.9116   1.295 0.195261    
## 2001 - 1993 == 0  14.7264    12.0324   1.224 0.220991    
## 2002 - 1993 == 0  23.5221    10.9116   2.156 0.031107 *  
## 2003 - 1993 == 0  25.8903    10.9116   2.373 0.017657 *  
## 2004 - 1993 == 0  31.7385    11.8884   2.670 0.007592 ** 
## 2005 - 1993 == 0  29.4752    10.9116   2.701 0.006907 ** 
## 2006 - 1993 == 0  37.8623    12.0324   3.147 0.001651 ** 
## 2007 - 1993 == 0  32.8421    10.9116   3.010 0.002614 ** 
## 2010 - 1993 == 0  37.8298    10.9116   3.467 0.000526 ***
## 2014 - 1993 == 0  37.1275    10.3377   3.591 0.000329 ***
## 2015 - 1993 == 0  42.2411    10.9116   3.871 0.000108 ***
## 2016 - 1993 == 0  34.1710    10.9116   3.132 0.001738 ** 
## 2017 - 1993 == 0  49.1344    10.9116   4.503 6.70e-06 ***
## 2018 - 1993 == 0  50.6156    10.9116   4.639 3.51e-06 ***
## 1995 - 1994 == 0   8.9017     9.7068   0.917 0.359113    
## 1997 - 1994 == 0  11.4564     8.6903   1.318 0.187406    
## 1998 - 1994 == 0   9.3426    10.8937   0.858 0.391104    
## 2000 - 1994 == 0  13.7713     9.7068   1.419 0.155980    
## 2001 - 1994 == 0  14.3653    10.8933   1.319 0.187258    
## 2002 - 1994 == 0  23.1610     9.7068   2.386 0.017030 *  
## 2003 - 1994 == 0  25.5292     9.7068   2.630 0.008538 ** 
## 2004 - 1994 == 0  31.3774    10.9116   2.876 0.004033 ** 
## 2005 - 1994 == 0  29.1141     9.7068   2.999 0.002706 ** 
## 2006 - 1994 == 0  37.5012    10.8933   3.443 0.000576 ***
## 2007 - 1994 == 0  32.4810     9.7068   3.346 0.000819 ***
## 2010 - 1994 == 0  37.4688     9.7068   3.860 0.000113 ***
## 2014 - 1994 == 0  36.7664     9.0921   4.044 5.26e-05 ***
## 2015 - 1994 == 0  41.8800     9.7068   4.314 1.60e-05 ***
## 2016 - 1994 == 0  33.8099     9.7068   3.483 0.000496 ***
## 2017 - 1994 == 0  48.7733     9.7068   5.025 5.04e-07 ***
## 2018 - 1994 == 0  50.2546     9.7068   5.177 2.25e-07 ***
## 1997 - 1995 == 0   2.5546     8.6903   0.294 0.768786    
## 1998 - 1995 == 0   0.4409    10.8937   0.040 0.967716    
## 2000 - 1995 == 0   4.8696     9.7068   0.502 0.615902    
## 2001 - 1995 == 0   5.4636    10.8933   0.502 0.615978    
## 2002 - 1995 == 0  14.2593     9.7068   1.469 0.141834    
## 2003 - 1995 == 0  16.6275     9.7068   1.713 0.086718 .  
## 2004 - 1995 == 0  22.4757    10.9116   2.060 0.039418 *  
## 2005 - 1995 == 0  20.2124     9.7068   2.082 0.037316 *  
## 2006 - 1995 == 0  28.5995    10.8933   2.625 0.008654 ** 
## 2007 - 1995 == 0  23.5793     9.7068   2.429 0.015135 *  
## 2010 - 1995 == 0  28.5670     9.7068   2.943 0.003251 ** 
## 2014 - 1995 == 0  27.8647     9.0921   3.065 0.002179 ** 
## 2015 - 1995 == 0  32.9783     9.7068   3.397 0.000680 ***
## 2016 - 1995 == 0  24.9082     9.7068   2.566 0.010287 *  
## 2017 - 1995 == 0  39.8716     9.7068   4.108 4.00e-05 ***
## 2018 - 1995 == 0  41.3528     9.7068   4.260 2.04e-05 ***
## 1998 - 1997 == 0  -2.1137     9.9627  -0.212 0.831979    
## 2000 - 1997 == 0   2.3150     8.6903   0.266 0.789942    
## 2001 - 1997 == 0   2.9090    10.0080   0.291 0.771307    
## 2002 - 1997 == 0  11.7047     8.6903   1.347 0.178023    
## 2003 - 1997 == 0  14.0729     8.6903   1.619 0.105366    
## 2004 - 1997 == 0  19.9211    10.0439   1.983 0.047321 *  
## 2005 - 1997 == 0  17.6578     8.6903   2.032 0.042164 *  
## 2006 - 1997 == 0  26.0449    10.0080   2.602 0.009257 ** 
## 2007 - 1997 == 0  21.0246     8.6903   2.419 0.015549 *  
## 2010 - 1997 == 0  26.0124     8.6903   2.993 0.002760 ** 
## 2014 - 1997 == 0  25.3101     7.9916   3.167 0.001540 ** 
## 2015 - 1997 == 0  30.4237     8.6903   3.501 0.000464 ***
## 2016 - 1997 == 0  22.3536     8.6903   2.572 0.010104 *  
## 2017 - 1997 == 0  37.3170     8.6903   4.294 1.75e-05 ***
## 2018 - 1997 == 0  38.7982     8.6903   4.465 8.02e-06 ***
## 2000 - 1998 == 0   4.4287    10.8937   0.407 0.684347    
## 2001 - 1998 == 0   5.0227    11.9837   0.419 0.675121    
## 2002 - 1998 == 0  13.8184    10.8937   1.268 0.204628    
## 2003 - 1998 == 0  16.1866    10.8937   1.486 0.137314    
## 2004 - 1998 == 0  22.0348    12.0336   1.831 0.067084 .  
## 2005 - 1998 == 0  19.7715    10.8937   1.815 0.069532 .  
## 2006 - 1998 == 0  28.1586    11.9837   2.350 0.018786 *  
## 2007 - 1998 == 0  23.1384    10.8937   2.124 0.033669 *  
## 2010 - 1998 == 0  28.1261    10.8937   2.582 0.009827 ** 
## 2014 - 1998 == 0  27.4238    10.3377   2.653 0.007983 ** 
## 2015 - 1998 == 0  32.5374    10.8937   2.987 0.002819 ** 
## 2016 - 1998 == 0  24.4673    10.8937   2.246 0.024704 *  
## 2017 - 1998 == 0  39.4307    10.8937   3.620 0.000295 ***
## 2018 - 1998 == 0  40.9119    10.8937   3.756 0.000173 ***
## 2001 - 2000 == 0   0.5940    10.8933   0.055 0.956513    
## 2002 - 2000 == 0   9.3897     9.7068   0.967 0.333380    
## 2003 - 2000 == 0  11.7579     9.7068   1.211 0.225780    
## 2004 - 2000 == 0  17.6061    10.9116   1.614 0.106631    
## 2005 - 2000 == 0  15.3428     9.7068   1.581 0.113965    
## 2006 - 2000 == 0  23.7299    10.8933   2.178 0.029376 *  
## 2007 - 2000 == 0  18.7097     9.7068   1.927 0.053921 .  
## 2010 - 2000 == 0  23.6974     9.7068   2.441 0.014634 *  
## 2014 - 2000 == 0  22.9951     9.0921   2.529 0.011435 *  
## 2015 - 2000 == 0  28.1087     9.7068   2.896 0.003782 ** 
## 2016 - 2000 == 0  20.0386     9.7068   2.064 0.038982 *  
## 2017 - 2000 == 0  35.0020     9.7068   3.606 0.000311 ***
## 2018 - 2000 == 0  36.4832     9.7068   3.759 0.000171 ***
## 2002 - 2001 == 0   8.7957    10.8933   0.807 0.419412    
## 2003 - 2001 == 0  11.1639    10.8933   1.025 0.305437    
## 2004 - 2001 == 0  17.0121    12.0324   1.414 0.157404    
## 2005 - 2001 == 0  14.7488    10.8933   1.354 0.175757    
## 2006 - 2001 == 0  23.1359    11.8884   1.946 0.051644 .  
## 2007 - 2001 == 0  18.1157    10.8933   1.663 0.096310 .  
## 2010 - 2001 == 0  23.1034    10.8933   2.121 0.033931 *  
## 2014 - 2001 == 0  22.4011    10.3919   2.156 0.031113 *  
## 2015 - 2001 == 0  27.5147    10.8933   2.526 0.011542 *  
## 2016 - 2001 == 0  19.4446    10.8933   1.785 0.074260 .  
## 2017 - 2001 == 0  34.4080    10.8933   3.159 0.001585 ** 
## 2018 - 2001 == 0  35.8892    10.8933   3.295 0.000986 ***
## 2003 - 2002 == 0   2.3682     9.7068   0.244 0.807251    
## 2004 - 2002 == 0   8.2164    10.9116   0.753 0.451451    
## 2005 - 2002 == 0   5.9531     9.7068   0.613 0.539684    
## 2006 - 2002 == 0  14.3402    10.8933   1.316 0.188030    
## 2007 - 2002 == 0   9.3200     9.7068   0.960 0.336983    
## 2010 - 2002 == 0  14.3077     9.7068   1.474 0.140486    
## 2014 - 2002 == 0  13.6054     9.0921   1.496 0.134550    
## 2015 - 2002 == 0  18.7190     9.7068   1.928 0.053801 .  
## 2016 - 2002 == 0  10.6489     9.7068   1.097 0.272620    
## 2017 - 2002 == 0  25.6123     9.7068   2.639 0.008325 ** 
## 2018 - 2002 == 0  27.0935     9.7068   2.791 0.005252 ** 
## 2004 - 2003 == 0   5.8482    10.9116   0.536 0.591985    
## 2005 - 2003 == 0   3.5849     9.7068   0.369 0.711891    
## 2006 - 2003 == 0  11.9720    10.8933   1.099 0.271756    
## 2007 - 2003 == 0   6.9518     9.7068   0.716 0.473886    
## 2010 - 2003 == 0  11.9395     9.7068   1.230 0.218693    
## 2014 - 2003 == 0  11.2372     9.0921   1.236 0.216486    
## 2015 - 2003 == 0  16.3508     9.7068   1.684 0.092093 .  
## 2016 - 2003 == 0   8.2807     9.7068   0.853 0.393617    
## 2017 - 2003 == 0  23.2441     9.7068   2.395 0.016638 *  
## 2018 - 2003 == 0  24.7253     9.7068   2.547 0.010859 *  
## 2005 - 2004 == 0  -2.2633    10.9116  -0.207 0.835681    
## 2006 - 2004 == 0   6.1238    12.0324   0.509 0.610792    
## 2007 - 2004 == 0   1.1036    10.9116   0.101 0.919442    
## 2010 - 2004 == 0   6.0913    10.9116   0.558 0.576679    
## 2014 - 2004 == 0   5.3890    10.3377   0.521 0.602164    
## 2015 - 2004 == 0  10.5026    10.9116   0.963 0.335790    
## 2016 - 2004 == 0   2.4325    10.9116   0.223 0.823593    
## 2017 - 2004 == 0  17.3959    10.9116   1.594 0.110878    
## 2018 - 2004 == 0  18.8771    10.9116   1.730 0.083629 .  
## 2006 - 2005 == 0   8.3871    10.8933   0.770 0.441339    
## 2007 - 2005 == 0   3.3668     9.7068   0.347 0.728702    
## 2010 - 2005 == 0   8.3546     9.7068   0.861 0.389408    
## 2014 - 2005 == 0   7.6523     9.0921   0.842 0.399990    
## 2015 - 2005 == 0  12.7659     9.7068   1.315 0.188462    
## 2016 - 2005 == 0   4.6958     9.7068   0.484 0.628557    
## 2017 - 2005 == 0  19.6592     9.7068   2.025 0.042838 *  
## 2018 - 2005 == 0  21.1404     9.7068   2.178 0.029415 *  
## 2007 - 2006 == 0  -5.0202    10.8933  -0.461 0.644901    
## 2010 - 2006 == 0  -0.0325    10.8933  -0.003 0.997620    
## 2014 - 2006 == 0  -0.7348    10.3919  -0.071 0.943626    
## 2015 - 2006 == 0   4.3788    10.8933   0.402 0.687706    
## 2016 - 2006 == 0  -3.6913    10.8933  -0.339 0.734713    
## 2017 - 2006 == 0  11.2721    10.8933   1.035 0.300775    
## 2018 - 2006 == 0  12.7533    10.8933   1.171 0.241700    
## 2010 - 2007 == 0   4.9878     9.7068   0.514 0.607364    
## 2014 - 2007 == 0   4.2854     9.0921   0.471 0.637403    
## 2015 - 2007 == 0   9.3990     9.7068   0.968 0.332900    
## 2016 - 2007 == 0   1.3289     9.7068   0.137 0.891106    
## 2017 - 2007 == 0  16.2923     9.7068   1.678 0.093262 .  
## 2018 - 2007 == 0  17.7736     9.7068   1.831 0.067096 .  
## 2014 - 2010 == 0  -0.7024     9.0921  -0.077 0.938426    
## 2015 - 2010 == 0   4.4113     9.7068   0.454 0.649505    
## 2016 - 2010 == 0  -3.6588     9.7068  -0.377 0.706223    
## 2017 - 2010 == 0  11.3046     9.7068   1.165 0.244182    
## 2018 - 2010 == 0  12.7858     9.7068   1.317 0.187774    
## 2015 - 2014 == 0   5.1136     9.0921   0.562 0.573827    
## 2016 - 2014 == 0  -2.9565     9.0921  -0.325 0.745051    
## 2017 - 2014 == 0  12.0069     9.0921   1.321 0.186639    
## 2018 - 2014 == 0  13.4881     9.0921   1.484 0.137941    
## 2016 - 2015 == 0  -8.0701     9.7068  -0.831 0.405757    
## 2017 - 2015 == 0   6.8933     9.7068   0.710 0.477612    
## 2018 - 2015 == 0   8.3745     9.7068   0.863 0.388279    
## 2017 - 2016 == 0  14.9634     9.7068   1.542 0.123187    
## 2018 - 2016 == 0  16.4446     9.7068   1.694 0.090241 .  
## 2018 - 2017 == 0   1.4812     9.7068   0.153 0.878718    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## (Univariate p values reported)

2. Stacked categories - Supplement? Uva Island

Only plots, not stats

Explore 4x5

Data4_5<-subset(cover, Location=="4x5")

Explore Uva chains

Data_Chain_Uva<-subset(cover, Location=="UvRf-Chains")

By transect

Mean Chains

Uva_1m2

Data_Uva12<-subset(cover, Location=="Uva_1m2")

By transect

Mean 1m2

Cover<-grid.arrange(Plot_45 , Plot_UvaChains, Plot_Uva1m2, ncol=1)

#ggsave(file="Outputs/Fig_S1.svg", plot=Cover, width=8, height=10)

3. Supplemantary datasets (Canal del Afuera and Secas)

Import data

# Read Canal de Afuera data (Pocillopora 2014-2018) 
  Data_CanalAfuera <- read.csv("Data/CA_cover.csv", header=TRUE, sep = ",")
  #summary(Data_CanalAfuera)
  
# Read Secas data (Massives 1980-2018) 
  Data_Chain_SECAS <- read.csv("Data/Secas_cover.csv", header=TRUE, sep = ",")
  #summary(Data_Chain_SECAS)
  
  # Read Secas + Uva data (Massives 1980-2018) 
  Suplementary.masssives <- read.csv("Data/Massives_cover.csv", header=TRUE, sep = ",")
  #summary(Suplementary.masssives)
  
  
# Format color
  FILL <-c("#C77CFF", "#F8766D", "#00BA38", "#619CFF")

Pocillopora non-Uva (Canal de Afuera)

Pocillopora_CA <- ggplot(Data_CanalAfuera, aes(x=YEAR, y=Pocillopora)) +
  geom_boxplot(aes(group=YEAR), outlier.shape = NA) +
  stat_boxplot(aes(group=YEAR), geom = 'errorbar')+
  geom_point(colour="#A3A500", alpha=0.3)+
  stat_summary(fun.y=mean, geom="line", colour="#A3A500") +
  stat_summary(fun.y=mean, geom="point", shape=21, size=2, alpha=0.8, fill="#A3A500") +
  
  scale_y_continuous("Canal de afuera reef \n Pocillopora cover (%)", 
                     limits = c(-2, 90), breaks = seq(0, 100, by=20),
                     expand = c(0,0.1))+
  scale_x_continuous("", limits = c(1979, 2019),
                     breaks = seq(1980, 2018, by=2), expand = c(0,0))+
  facet_grid(Location~., scales="free")+
  
  ggtitle("a.")+
  
  annotate("rect", xmin = 1982, xmax = 1983, ymin = 0, ymax = 80,  alpha = .2, fill="gray")+
  annotate("rect", xmin = 1997, xmax = 1998, ymin = 0, ymax = 80,  alpha = .2, fill="gray")+
  annotate("rect", xmin = 2015, xmax = 2016, ymin = 0, ymax = 80,  alpha = .2, fill="gray")+
  facet_grid(Location~.)
Pocillopora_CA 

  • LMER model
  Data_CanalAfuera$Year_F<-as.factor(Data_CanalAfuera$YEAR)

  model_CA <- lme(
    Pocillopora ~ -1 + Year_F, random = ~1|Transect, data=Data_CanalAfuera)
  summary(model_CA)
## Linear mixed-effects model fit by REML
##   Data: Data_CanalAfuera 
##        AIC      BIC    logLik
##   114.7784 118.3186 -52.38918
## 
## Random effects:
##  Formula: ~1 | Transect
##         (Intercept) Residual
## StdDev:    9.232427 4.216186
## 
## Fixed effects:  Pocillopora ~ -1 + Year_F 
##               Value Std.Error DF  t-value p-value
## Year_F2015 57.43305  4.143548 10 13.86084       0
## Year_F2016 57.00977  4.143548 10 13.75868       0
## Year_F2018 70.15725  4.143548 10 16.93169       0
##  Correlation: 
##            Y_F2015 Y_F2016
## Year_F2016 0.827          
## Year_F2018 0.827   0.827  
## 
## Standardized Within-Group Residuals:
##         Min          Q1         Med          Q3         Max 
## -1.05091857 -0.65554034 -0.05954312  0.42760030  1.72437930 
## 
## Number of Observations: 18
## Number of Groups: 6
  anova(model_CA)
  plot(ranef(model_CA))    # Symmetrical scatter effects around zero?
  plot(model_CA)           # plot residuals vs fitted
  resnorm1 <- resid(model_CA)
  hist(resnorm1, xlab = "Residuals", main = "") # are residuals normally distributed?
  coef.m1 <- as.data.frame(coef(summary(model_CA)))    # Coefficients of the model
  
  plot(model_CA, resid(., type = "p") ~ fitted(.) | Location, abline = 0)
  plot(model_CA, Pocillopora ~ fitted(.), abline = c(0,1))
  
# Multicomp
    Year_F.emm<-emmeans(model_CA, ~Year_F)
    #contrast(Year_F.emm, "tukey")
    year_groups<-cld(Year_F.emm, by=NULL) # compact-letter display
    year_groups
# Effect plot
  plot(emmeans(model_CA, ~Year_F), comparisons = TRUE) +
      coord_flip(xlim = NULL, ylim = NULL, expand = TRUE) + theme_bw() +
    theme(axis.text.x = element_text(angle = 90)) + 
    ggtitle("Model CA preditions")

  • Summary stats Pocillopora CA

Massives Secas

Massive_Secas <- ggplot(Data_Chain_SECAS, aes(x=YEAR, y=Massive)) +
  geom_boxplot(aes(group=YEAR), outlier.shape = NA) +
  stat_boxplot(aes(group=YEAR), geom = 'errorbar')+
  #geom_smooth(method = lm, se=FALSE, linetype = "dashed", colour="red")+
  #geom_smooth(span = 0.2, se=T, colour="darkgray")+ 
  stat_summary(fun.y=mean, geom="line") +
  geom_point(aes(fill=Transect), alpha=0.5, shape=21) +
  
  scale_y_continuous("Secas Island reef \n Non-Pocillopora scleractinians cover (%)", 
                     limits = c(-2, 80), breaks = seq(0, 100, by=10),
                     expand = c(0,0.1)
                     )+
  scale_x_continuous("", limits = c(1979, 2019),
                     breaks = seq(1980, 2018, by=2)#, 
                     #expand = c(0.1,0)
                     )+
  annotate("rect", xmin = 1982, xmax = 1983, ymin = 0, ymax = 70,  alpha = .2, fill="gray")+
  annotate("rect", xmin = 1997, xmax = 1998, ymin = 0, ymax = 70,  alpha = .2, fill="gray")+
  annotate("rect", xmin = 2015, xmax = 2016, ymin = 0, ymax = 70,  alpha = .2, fill="gray")+
  #facet_grid(Location~., scales="free_y")
  ggtitle("b.")
Massive_Secas

  • LMER model SECAS
  Data_Chain_SECAS$Year_F<-as.factor(Data_Chain_SECAS$YEAR)

  model_Secas <- lme(
    Massive ~ -1 + Year_F, random = ~1|Transect, data=Data_Chain_SECAS)
  summary(model_Secas)
## Linear mixed-effects model fit by REML
##   Data: Data_Chain_SECAS 
##        AIC      BIC    logLik
##   1734.272 1796.924 -849.1361
## 
## Random effects:
##  Formula: ~1 | Transect
##          (Intercept) Residual
## StdDev: 0.0004912232 7.641786
## 
## Fixed effects:  Massive ~ -1 + Year_F 
##                Value Std.Error  DF   t-value p-value
## Year_F1975  1.891718  1.528357 231  1.237746  0.2171
## Year_F1976  0.898021  1.708755 231  0.525541  0.5997
## Year_F1977  1.621573  1.208273 231  1.342059  0.1809
## Year_F1978  1.679452  1.080712 231  1.554024  0.1215
## Year_F1980 18.183354  1.753146 231 10.371842  0.0000
## Year_F1983  0.385200  2.416545 231  0.159401  0.8735
## Year_F1997  0.225000  2.416545 231  0.093108  0.9259
## Year_F1998  0.904762  2.888324 231  0.313248  0.7544
## Year_F2000  0.000000  2.416545 231  0.000000  1.0000
## Year_F2002  0.158157  2.416545 231  0.065448  0.9479
## Year_F2003  0.500000  2.416545 231  0.206907  0.8363
## Year_F2004  0.300000  2.416545 231  0.124144  0.9013
## Year_F2005  0.200000  2.416545 231  0.082763  0.9341
## Year_F2010  1.200000  2.416545 231  0.496577  0.6200
## Year_F2015  0.264049  3.417511 231  0.077264  0.9385
## Year_F2018  0.070547  2.416545 231  0.029193  0.9767
##  Correlation: 
##            Y_F1975 Y_F1976 Y_F1977 Y_F1978 Y_F1980 Y_F1983 Y_F1997 Y_F1998
## Year_F1976 0                                                              
## Year_F1977 0       0                                                      
## Year_F1978 0       0       0                                              
## Year_F1980 0       0       0       0                                      
## Year_F1983 0       0       0       0       0                              
## Year_F1997 0       0       0       0       0       0                      
## Year_F1998 0       0       0       0       0       0       0              
## Year_F2000 0       0       0       0       0       0       0       0      
## Year_F2002 0       0       0       0       0       0       0       0      
## Year_F2003 0       0       0       0       0       0       0       0      
## Year_F2004 0       0       0       0       0       0       0       0      
## Year_F2005 0       0       0       0       0       0       0       0      
## Year_F2010 0       0       0       0       0       0       0       0      
## Year_F2015 0       0       0       0       0       0       0       0      
## Year_F2018 0       0       0       0       0       0       0       0      
##            Y_F2000 Y_F2002 Y_F2003 Y_F2004 Y_F2005 Y_F2010 Y_F2015
## Year_F1976                                                        
## Year_F1977                                                        
## Year_F1978                                                        
## Year_F1980                                                        
## Year_F1983                                                        
## Year_F1997                                                        
## Year_F1998                                                        
## Year_F2000                                                        
## Year_F2002 0                                                      
## Year_F2003 0       0                                              
## Year_F2004 0       0       0                                      
## Year_F2005 0       0       0       0                              
## Year_F2010 0       0       0       0       0                      
## Year_F2015 0       0       0       0       0       0              
## Year_F2018 0       0       0       0       0       0       0      
## 
## Standardized Within-Group Residuals:
##          Min           Q1          Med           Q3          Max 
## -2.379463717 -0.212198142 -0.075570702 -0.004047582  6.834475873 
## 
## Number of Observations: 256
## Number of Groups: 10
  anova(model_Secas)
  plot(ranef(model_Secas))    # Symmetrical scatter effects around zero?
  plot(model_Secas)           # plot residuals vs fitted
  resnorm1 <- resid(model_Secas)
  hist(resnorm1, xlab = "Residuals", main = "") # are residuals normally distributed?
  coef.m1 <- as.data.frame(coef(summary(model_Secas)))    # Coefficients of the model
  
  plot(model_Secas, resid(., type = "p") ~ fitted(.) | Location, abline = 0)
  plot(model_Secas, Pocillopora ~ fitted(.), abline = c(0,1))
  
# Multicomp
    Year_F.emm<-emmeans(model_Secas, ~Year_F)
    #contrast(Year_F.emm, "tukey")
    year_groups<-cld(Year_F.emm, by=NULL) # compact-letter display
    year_groups
# Effect plot
  plot(emmeans(model_Secas, ~Year_F), comparisons = TRUE) +
      coord_flip(xlim = NULL, ylim = NULL, expand = TRUE) + theme_bw() +
    theme(axis.text.x = element_text(angle = 90)) + 
    ggtitle("Model Secas preditions")

  • Summary stats Massives Secas

Massives Uva+Secas

Other Supplemetary figures cover

Packages used

Auguie, Baptiste. 2017. GridExtra: Miscellaneous Functions for "Grid" Graphics. https://CRAN.R-project.org/package=gridExtra.

Genz, Alan, and Frank Bretz. 2009. Computation of Multivariate Normal and T Probabilities. Lecture Notes in Statistics. Heidelberg: Springer-Verlag.

Genz, Alan, Frank Bretz, Tetsuhisa Miwa, Xuefei Mi, and Torsten Hothorn. 2020. Mvtnorm: Multivariate Normal and T Distributions. http://mvtnorm.R-forge.R-project.org.

Hothorn, Torsten. 2019. TH.data: TH’s Data Archive. https://CRAN.R-project.org/package=TH.data.

Hothorn, Torsten, Frank Bretz, and Peter Westfall. 2008. “Simultaneous Inference in General Parametric Models.” Biometrical Journal 50 (3): 346–63.

———. 2021. Multcomp: Simultaneous Inference in General Parametric Models. https://CRAN.R-project.org/package=multcomp.

Lenth, Russell V. 2021. Emmeans: Estimated Marginal Means, Aka Least-Squares Means. https://github.com/rvlenth/emmeans.

Pinheiro, José, Douglas Bates, and R-core. 2021. Nlme: Linear and Nonlinear Mixed Effects Models. https://svn.r-project.org/R-packages/trunk/nlme/.

R Core Team. 2020. R: A Language and Environment for Statistical Computing. Vienna, Austria: R Foundation for Statistical Computing. https://www.R-project.org/.

Ripley, Brian. 2021. MASS: Support Functions and Datasets for Venables and Ripley’s Mass. http://www.stats.ox.ac.uk/pub/MASS4/.

Terry M. Therneau, and Patricia M. Grambsch. 2000. Modeling Survival Data: Extending the Cox Model. New York: Springer.

Therneau, Terry M. 2021. Survival: Survival Analysis. https://github.com/therneau/survival.

Venables, W. N., and B. D. Ripley. 2002. Modern Applied Statistics with S. Fourth. New York: Springer. https://www.stats.ox.ac.uk/pub/MASS4/.

Wickham, Hadley. 2016. Ggplot2: Elegant Graphics for Data Analysis. Springer-Verlag New York. https://ggplot2.tidyverse.org.

Wickham, Hadley, Winston Chang, Lionel Henry, Thomas Lin Pedersen, Kohske Takahashi, Claus Wilke, Kara Woo, Hiroaki Yutani, and Dewey Dunnington. 2020. Ggplot2: Create Elegant Data Visualisations Using the Grammar of Graphics. https://CRAN.R-project.org/package=ggplot2.

Wickham, Hadley, Romain François, Lionel Henry, and Kirill Müller. 2021. Dplyr: A Grammar of Data Manipulation. https://CRAN.R-project.org/package=dplyr.

Wickham, Hadley, and Dana Seidel. 2020. Scales: Scale Functions for Visualization. https://CRAN.R-project.org/package=scales.